Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index International Gentoo Users Polskie forum (Polish) Instalacja i sprzęt
  • Search

[INSTALL] bezpieczne flagi + gcc

Pytania i problemy związane z instalacją Gentoo oraz sprzętem

Moderator: SlashBeast

Post Reply
  • Print view
Advanced search
14 posts • Page 1 of 1
Author
Message
tuniek
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 113
Joined: Sat Jun 11, 2005 7:38 am
Location: Poland

[INSTALL] bezpieczne flagi + gcc

  • Quote

Post by tuniek » Mon Dec 19, 2005 11:52 am

Pytam bo chcę sie upewnić.

Niedawno zainstalowałem gentoo na dwuprocesorowej maszynie (HT):

Code: Select all

cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz         : 3000.242
cache size      : 16 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl cid
bogomips        : 5989.99

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz         : 3000.242
cache size      : 16 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl cid
bogomips        : 5989.99

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz         : 3000.242
cache size      : 16 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl cid
bogomips        : 5989.99

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz         : 3000.242
cache size      : 16 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl cid
bogomips        : 5989.99
wrzuciłem "bezpieczne flagi" takie jakie są sugerowane na http://gentoo-wiki.com/Safe_Cflags

czyli:

Code: Select all

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -fomit-frame-pointer -mmmx -msse2 -mfpmath=sse -pipe"
CXXFLAGS="${CFLAGS}"

MAKEOPTS="-j5"
instalowałem zgodnie z nowym handbookiem ... no i jechałem ze stage-a "x86" ...

Przy kompilowaniu gliba dostaję błąd:

Code: Select all


....

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -pthread -march=nocona -O2 -fomit-frame-pointer -mmmx -msse2 -mfpmath=sse -pipe -Wall -MT garray.lo -MD -MP -MF .deps/garray.Tpo -c garray.c  -fPIC -DPIC -o .libs/garray.o
{standard input}: Assembler messages:
{standard input}:54: Error: suffix or operands invalid for `cmpxchg'
make[4]: *** [gatomic.lo] Błąd 1
make[4]: *** Czekam na niezakończone zadania....
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -pthread -march=nocona -O2 -fomit-frame-pointer -mmmx -msse2 -mfpmath=sse -pipe -Wall -MT gcache.lo -MD -MP -MF .deps/gcache.Tpo -c gcache.c  -fPIC -DPIC -o .libs/gcache.o
make[4]: Leaving directory `/var/tmp/portage/glib-2.6.5/work/glib-2.6.5/glib'
make[3]: *** [all-recursive] Błąd 1
make[3]: Leaving directory `/var/tmp/portage/glib-2.6.5/work/glib-2.6.5/glib'
make[2]: *** [all] Błąd 2
make[2]: Leaving directory `/var/tmp/portage/glib-2.6.5/work/glib-2.6.5/glib'
make[1]: *** [all-recursive] Błąd 1
make[1]: Leaving directory `/var/tmp/portage/glib-2.6.5/work/glib-2.6.5'
make: *** [all] Błąd 2

!!! ERROR: dev-libs/glib-2.6.5 failed.
!!! Function src_compile, Line 51, Exitcode 2
!!! (no error message)

Na gentoo-wiki jest uwaga przy tych flagach, że zalecane jest przejście na gcc. >=3.4 ... nie zrobiłem tego ...

Czy to jest własnie odpowiedź na mój problem?
"The reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." (George Bernard Shaw)
Top
red.13
n00b
n00b
User avatar
Posts: 11
Joined: Thu Dec 30, 2004 4:35 pm
Location: Gliwice - Poland

  • Quote

Post by red.13 » Tue Dec 20, 2005 11:14 pm

Co prawda nie znam odpowiedzi na twój problem, ale czy przypadkiem fomit-frame-pointer może być (czyt. powinien) dołączany do kompilacji pod C++? Dzięki Bogu zawsze masz jeszcze możliwość sprawdzenia GCC 3.4+ :).
"I can (well, almost) hear you asking yourselves "why?". Hurd will be out in a year (or two, or next month, who knows), and I've already got
minix.
" :D
--Linus about starting the Linux project (1991)
Top
noobah
Apprentice
Apprentice
User avatar
Posts: 210
Joined: Mon Apr 11, 2005 1:56 pm
Location: Ustonie Morskie, Poland

  • Quote

Post by noobah » Wed Dec 21, 2005 12:24 am

Kiedyś było dużo szumu wokół -fomit-frame-pointer - bardzo często się kompilacje wykrzaczaly z tą flagą, ale zostało to naprawione w gcc-3.4 .
Wg mnie to może być twój problem.
the force is strong with me
Top
mbar
Advocate
Advocate
User avatar
Posts: 2000
Joined: Wed Jan 19, 2005 9:45 am
Location: Poland

  • Quote

Post by mbar » Wed Dec 21, 2005 5:46 am

-mfpmath=sse nie jest ani bezpieczne, ani sensowne, usuń to
Top
Raku
Bodhisattva
Bodhisattva
User avatar
Posts: 2374
Joined: Sat Feb 28, 2004 12:02 am
Location: Poland

  • Quote

Post by Raku » Wed Dec 21, 2005 8:20 am

mbar wrote:-mfpmath=sse nie jest ani bezpieczne, ani sensowne, usuń to
chyba ci się coś pomerdało z -ffast-math
raku

Powered by Archlinux ;-)
Top
tuniek
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 113
Joined: Sat Jun 11, 2005 7:38 am
Location: Poland

  • Quote

Post by tuniek » Wed Dec 21, 2005 9:06 am

Spróbowałem uaktualnić gcc ....

wywala mi się już na początku ...

Code: Select all

 emerge -uv gcc --resume
* --verbose is currently broken with --resume. Disabling...
*** Resuming merge...
>>> emerge (1 of 5) sys-devel/gcc-config-1.3.12-r4 to /
>>> md5 files   ;-) gcc-config-2.0.0_beta2.ebuild
>>> md5 files   ;-) gcc-config-1.3.12-r4.ebuild
>>> md5 files   ;-) files/digest-gcc-config-1.3.12-r4
>>> md5 files   ;-) files/wrapper-1.4.7.c
>>> md5 files   ;-) files/digest-gcc-config-2.0.0_beta2
>>> md5 files   ;-) files/gcc-config-1.3.12
>>> Unpacking source...
>>> Source unpacked.
/var/tmp/portage/gcc-config-1.3.12-r4/temp/cc8EGQkN.s: Assembler messages:
/var/tmp/portage/gcc-config-1.3.12-r4/temp/cc8EGQkN.s:26: Error: suffix or operands invalid for `push'
/var/tmp/portage/gcc-config-1.3.12-r4/temp/cc8EGQkN.s:28: Error: suffix or operands invalid for `push'
/var/tmp/portage/gcc-config-1.3.12-r4/temp/cc8EGQkN.s:30: Error: suffix or operands invalid for `push'
...
...
...
/var/tmp/portage/gcc-config-1.3.12-r4/temp/cc8EGQkN.s:1174: Error: suffix or operands invalid for `push'
/var/tmp/portage/gcc-config-1.3.12-r4/temp/cc8EGQkN.s:1175: Error: suffix or operands invalid for `push'

!!! ERROR: sys-devel/gcc-config-1.3.12-r4 failed.
!!! Function src_compile, Line 25, Exitcode 1
!!! compile wrapper

Próbowałem przy dwóch ustawieniach w make.conf:
1)

Code: Select all

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2  -mmmx -msse2  -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j5"
2)

Code: Select all

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2  -mmmx -msse2  -fomit-frame-pointer  -mfpmath=sse  -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j5"
efekt jest ten sam ...

Może popełniam jakiś grubszy błąd?
"The reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." (George Bernard Shaw)
Top
mbar
Advocate
Advocate
User avatar
Posts: 2000
Joined: Wed Jan 19, 2005 9:45 am
Location: Poland

  • Quote

Post by mbar » Wed Dec 21, 2005 10:00 am

@raku: nie pomerdało się, polecam poczytać co nieco
Top
Raku
Bodhisattva
Bodhisattva
User avatar
Posts: 2374
Joined: Sat Feb 28, 2004 12:02 am
Location: Poland

  • Quote

Post by Raku » Wed Dec 21, 2005 10:20 am

mbar wrote:@raku: nie pomerdało się, polecam poczytać co nieco
a możesz jakieś linki zapodać?
bo na stronie domowej gcc wyczytałem jedynie, że np. dla x86_64 flaga ta jest domyślnie włączana
raku

Powered by Archlinux ;-)
Top
damjanek
Apprentice
Apprentice
User avatar
Posts: 259
Joined: Mon Jun 21, 2004 2:16 pm
Location: Poland, Poznań

  • Quote

Post by damjanek » Wed Dec 21, 2005 3:19 pm

jeśli to ma być 64bitowa instalacja, to należałoby chyba użyć livecd i stage dla amd64, afair...
$ ❯ uname -rms
Darwin 24.2.0 arm64
Welcome to Darwin!
#gentoo-pl@libera team
Top
tuniek
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 113
Joined: Sat Jun 11, 2005 7:38 am
Location: Poland

  • Quote

Post by tuniek » Wed Dec 21, 2005 6:49 pm

jeśli to ma być 64bitowa instalacja, to należałoby chyba użyć livecd i stage dla amd64, afair...
noo ja w sumie jechałem z x86 ...
"The reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." (George Bernard Shaw)
Top
mbar
Advocate
Advocate
User avatar
Posts: 2000
Joined: Wed Jan 19, 2005 9:45 am
Location: Poland

  • Quote

Post by mbar » Wed Dec 21, 2005 7:57 pm

więc po 1-wsze, flaga -mfpmath nie działa poprawnie w gcc w wersjach wcześniejszych niż 4.x (nie to że programy nie działają, tylko działają gorzej)
po 2-gie: "-mfpmath=sse will most likely slow FPU calculations down, but your mileage may vary. If you're not sure that it will speed things up, get rid of it. You won't notice the difference unless you run some heavy-duty scientific software applications."
po 3-cie: "-ftracer bloats code a bit so I suggest that you remove it too. "
po 4-te: "-fweb makes compilation times longer and doesen't do much good"

ja od dłuższego czasu kompiluję cały system z flagami:

Code: Select all

CFLAGS="-Os -march=ARCHITEKTURA -pipe -fomit-frame-pointer -fforce-addr -ffast-math -falign-functions=4"
(lub =5 na AMD64).

polecam też http://forums.gentoo.org/viewtopic-t-318191.html skąd zaczerpnąłem cytaty :)
Top
Raku
Bodhisattva
Bodhisattva
User avatar
Posts: 2374
Joined: Sat Feb 28, 2004 12:02 am
Location: Poland

  • Quote

Post by Raku » Wed Dec 21, 2005 8:24 pm

mbar wrote:polecam też http://forums.gentoo.org/viewtopic-t-318191.html skąd zaczerpnąłem cytaty :)
widzisz - co strona to inny expert. Ja znalazłem cos takiego. Wynika tu, że -mfpmath=sse jednak przyśpiesza działanie programu.

Ja bym sie wstrzymał z komentowaniem działania poszczególnych flag bez jakichkolwiek testów, polegając jedynie na zasłyszanych opiniach.
raku

Powered by Archlinux ;-)
Top
mbar
Advocate
Advocate
User avatar
Posts: 2000
Joined: Wed Jan 19, 2005 9:45 am
Location: Poland

  • Quote

Post by mbar » Wed Dec 21, 2005 8:48 pm

Ja bym się wstrzymał przed wyciąganiem wniosków na podstawie tak wątpliwego testu. Zobacz

Code: Select all

-Os -march=pentium3 -s -fomit-frame-pointer -pipe 0,54382833
-Os -march=pentium3 -s -mfpmath=sse -pipe 0,47106759
-Os -march=i686 -s -fomit-frame-pointer -pipe 0,45700264
-Os -mtune=i686 -s -fomit-frame-pointer -pipe 0,45439498
im mniej tym lepiej, wygrywa kompilacja na i686 i generalnie -Os wychodzi najlepiej. Ale jedyny wniosek, jaki można z tego wyciągnąć, to to, że gcc 3.4.3 daje dupy i nie potrafi optymalizować kodu po włączeniu march=pentium3. W tym teście mfpmath=sse nie powoduje przyśpieszenia działania programu, tylko nieco naprawia to, co march=pentium3 zepsuło.
PS. ja używam gcc-4.0.2
PS2. Poza tym inne testy dowodzą czego innego (wiadomo ;) ) Np. acovea pokazuje:
http://www.coyotegulch.com/products/aco ... gcc40.html
"GCC should strongly consider changing the default for AMD64 to -mfpmath=387 when -funsafe-math-optimizations is enabled." ... "that -funsafe-math-optimizations (a component of -ffast-math) is only effective when it is coupled with -mfpmath=387. For Opteron processors, the default settings is -mfpmath=sse — and SSE mathematics do not include all of the intrinsic mathematical functions that can be inlined via -funsafe-math-optimizations." ... "A higher "-O" level does not guarantee faster code. By implication, -O3 should produce code that is faster than -O1, but it doesn't."
To ostatnie stwierdzenie jest bolesne, ale także widoczne i w tym podanym przez Ciebie teście.

Generalnie wychodzi na to, że dla desktopowego systemu nie warto przesadzać z ustawianiem CFLAGS. Odkąd używam -Os mój laptop zachowuje się zauważalnie lepiej.
Top
mirekm
Apprentice
Apprentice
User avatar
Posts: 237
Joined: Thu Feb 12, 2004 8:17 am
Location: Gliwice

  • Quote

Post by mirekm » Sun Dec 25, 2005 9:30 am

Zaraz zaraz.
Chyba coś mieszacie. Flaga -mfpmath=sse nie jest zalecana dla procesorów nie posiadających SSE2, ponieważ sse v1 ma zbyt małą dokładność obliczeń (za mała liczba bitów), a po drugie nie działa najlepiej.
Z tego wynika, żeby w pentium 3 nie używać, ale w pentium 4 już tak (bo wykorzystywane jest sse2)

Pozdrawiam
Top
Post Reply
  • Print view

14 posts • Page 1 of 1

Return to “Instalacja i sprzęt”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic