Safe Cflags/Via

Nano (Isaiah)
vendor_id : CentaurHauls cpu family : 6 model : 15 model name :  VIA Nano processor U2250 (1.6GHz Capable)

GCC 4.5.4: CHOST="x86_64-pc-linux-gnu" CFLAGS="-march=native -Os -pipe"

Eden
GCC 4.2+: CHOST="i686-pc-linux-gnu" CFLAGS="-march=c3-2 -mtune=c3-2 -pipe -mfpmath=sse,387 -msse2 -mmmx -msse"

Esther C5J (Via C7)
vendor_id : CentaurHauls cpu family : 6 model : 10 model name : VIA Esther processor 2000MHz

CHOST="i686-pc-linux-gnu" CFLAGS="-march=i686 -mmmx -msse -msse2 -msse3 -O2 -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}"

As the C7 has the pni flag in /proc/cpuinfo, it supports SSE3. Search for pni on this page to get the explanation.

Forcing -mss* can produce broken code under certain circumstances, following is safe in this regard:

CHOST="i686-pc-linux-gnu" CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}"

C3 Nehemiah (C5X/C5XL/C5P)
vendor_id : CentaurHauls cpu family : 6 model : 9 model name : VIA Nehemiah

GCC 3.3 and earlier: CHOST="i686-pc-linux-gnu" CFLAGS="-march=i686 -msse -mmmx -O2 -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}"

GCC 3.4 and later CHOST="i686-pc-linux-gnu" CFLAGS="-march=c3-2 -O2 -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}"

For example, to generate i686 code(with cmov) for Via C3 Nehemiah use: CHOST="i686-pc-linux-gnu" CFLAGS="-march=c3-2 -mtune=generic -O2 -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}"

C3 Samuel/Ezra (Via EPIA)
processor : 0 vendor_id : CentaurHauls cpu family : 6 model : 7 model name : VIA Samuel 2

CHOST="i586-pc-linux-gnu" CFLAGS="-march=c3 -m3dnow -O2 -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}"

The Ezra doesn't have any special instructions that you could optimize for, just consider it a K6-3 - basically a Pentium 2 with 3DNow.

Bezpečné Cflagy/Via Cflags sûr/Via Bezpieczne CFLAGS/Via