Hey everyone! This is not really an important issue, I just wanted to find out if anyone had it on his or her radar. I have a machine that isn't too powerful and hasn't got a lot of RAM either. So as an experiment I wanted to compile the world with the option for conserving space. Unfortunately, that didn't work out too well as it broke the compile (see last lines appended after my signature). I updated with svn to version 249301 before compiling. The same code compiled with O2 works fine. I know you are going to ask about my CFLAGS, so here they are: CPUTYPE= athlon-xp CFLAGS= -O2 -fno-strict-aliasing -pipe -mtune=athlon-xp -march=athlon-xp And yes, the CPU is really an Athlon XP. ;-) The only change I need to make to break the compile is -O2 to -Os. Has anyone noticed this too? Best regards, Chris famous last lines... :-) cc -Os -fno-strict-aliasing -pipe -mtune=athlon-xp -march=athlon-xp -march=athlon-xp -DPTHREAD_KERNEL -I/usr/src/lib/libthr/../libc/include -I/usr/src/lib/libthr/thread -I/usr/src/lib/libthr/../../include -I/usr/src/lib/libthr/arch/i386/include -I/usr/src/lib/libthr/sys -I/usr/src/lib/libthr/../../libexec/rtld-elf -I/usr/src/lib/libthr/../../libexec/rtld-elf/i386 -I/usr/src/lib/libthr/../libthread_db -Winline -D_PTHREADS_INVARIANTS -DSYSCALL_COMPAT -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libthr/sys/thr_error.c cc -Os -fno-strict-aliasing -pipe -mtune=athlon-xp -march=athlon-xp -march=athlon-xp -DPTHREAD_KERNEL -I/usr/src/lib/libthr/../libc/include -I/usr/src/lib/libthr/thread -I/usr/src/lib/libthr/../../include -I/usr/src/lib/libthr/arch/i386/include -I/usr/src/lib/libthr/sys -I/usr/src/lib/libthr/../../libexec/rtld-elf -I/usr/src/lib/libthr/../../libexec/rtld-elf/i386 -I/usr/src/lib/libthr/../libthread_db -Winline -D_PTHREADS_INVARIANTS -DSYSCALL_COMPAT -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libthr/thread/thr_affinity.c cc1: warnings being treated as errors /usr/src/lib/libthr/thread/thr_affinity.c: In function '_pthread_setaffinity_np': /usr/src/lib/libthr/thread/thr_umtx.h:103: warning: inlining failed in call to '_thr_umutex_unlock': --param max-inline-insns-single limit reached /usr/src/lib/libthr/thread/thr_affinity.c:56: warning: called from here /usr/src/lib/libthr/thread/thr_umtx.h:103: warning: inlining failed in call to '_thr_umutex_unlock': --param max-inline-insns-single limit reached /usr/src/lib/libthr/thread/thr_affinity.c:64: warning: called from here *** Error code 1 Stop in /usr/src/lib/libthr. *** Error code 1 Stop in /usr/src. *** Error code 1
On Tue, Apr 09, 2013 at 02:50:29PM +0200, Christian Baer wrote:> Hey everyone! > > This is not really an important issue, I just wanted to find out if anyone had > it on his or her radar. > > I have a machine that isn't too powerful and hasn't got a lot of RAM either. > So as an experiment I wanted to compile the world with the option for > conserving space. Unfortunately, that didn't work out too well as it broke the > compile (see last lines appended after my signature). > > I updated with svn to version 249301 before compiling. > > The same code compiled with O2 works fine. I know you are going to ask about > my CFLAGS, so here they are: > > CPUTYPE= athlon-xp > CFLAGS= -O2 -fno-strict-aliasing -pipe -mtune=athlon-xp -march=athlon-xp > > And yes, the CPU is really an Athlon XP. ;-) > The only change I need to make to break the compile is -O2 to -Os. > > Has anyone noticed this too?A few things: 1. You didn't state which compiler you're using. 2. Your CFLAGS line above shows -O2, yet your output below shows -Os, and your Subject line is talking about -Os. 3. You should use CPUTYPE?= not CPUTYPE. 4. You need to use CFLAGS+= not CFLAGS=, otherwise you're effectively overriding flags that may be needed/set elsewhere within Makefiles. Furthermore, are you aware of the other internals which -Os disables? -Os disables the following optimization flags: -falign-functions -falign-jumps -falign-loops -falign-labels -freorder-blocks -freorder-blocks-and-partition -fprefetch-loop-arrays -ftree-vect-loop-version I would suggest not messing with the optimisation level in CFLAGS. This has come up/been discussed on the mailing lists repeatedly for almost two decades. I believe I read somewhere that adjusting that is basically "not supported" nor will it ever be.> famous last lines... :-) > > cc -Os -fno-strict-aliasing -pipe -mtune=athlon-xp -march=athlon-xp > -march=athlon-xp -DPTHREAD_KERNEL -I/usr/src/lib/libthr/../libc/include > -I/usr/src/lib/libthr/thread -I/usr/src/lib/libthr/../../include > -I/usr/src/lib/libthr/arch/i386/include -I/usr/src/lib/libthr/sys > -I/usr/src/lib/libthr/../../libexec/rtld-elf > -I/usr/src/lib/libthr/../../libexec/rtld-elf/i386 > -I/usr/src/lib/libthr/../libthread_db -Winline -D_PTHREADS_INVARIANTS > -DSYSCALL_COMPAT -std=gnu99 -Wsystem-headers -Werror -Wall > -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign > -c /usr/src/lib/libthr/sys/thr_error.c cc -Os -fno-strict-aliasing -pipe > -mtune=athlon-xp -march=athlon-xp -march=athlon-xp -DPTHREAD_KERNEL > -I/usr/src/lib/libthr/../libc/include -I/usr/src/lib/libthr/thread > -I/usr/src/lib/libthr/../../include > -I/usr/src/lib/libthr/arch/i386/include -I/usr/src/lib/libthr/sys > -I/usr/src/lib/libthr/../../libexec/rtld-elf > -I/usr/src/lib/libthr/../../libexec/rtld-elf/i386 > -I/usr/src/lib/libthr/../libthread_db -Winline -D_PTHREADS_INVARIANTS > -DSYSCALL_COMPAT -std=gnu99 -Wsystem-headers -Werror -Wall > -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign > -c /usr/src/lib/libthr/thread/thr_affinity.c > cc1: warnings being treated as errors > /usr/src/lib/libthr/thread/thr_affinity.c: In function > '_pthread_setaffinity_np': /usr/src/lib/libthr/thread/thr_umtx.h:103: > warning: inlining failed in call to '_thr_umutex_unlock': --param > max-inline-insns-single limit reached > /usr/src/lib/libthr/thread/thr_affinity.c:56: warning: called from here > /usr/src/lib/libthr/thread/thr_umtx.h:103: warning: inlining failed in > call to '_thr_umutex_unlock': --param max-inline-insns-single limit > reached /usr/src/lib/libthr/thread/thr_affinity.c:64: warning: called > from here *** Error code 1 > > Stop in /usr/src/lib/libthr. > *** Error code 1 > > Stop in /usr/src. > *** Error code 1-- | Jeremy Chadwick jdc at koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |
On Apr 9, 2013, at 14:50, Christian Baer <christian.baer at uni-dortmund.de> wrote: ...> CPUTYPE= athlon-xp > CFLAGS= -O2 -fno-strict-aliasing -pipe -mtune=athlon-xp -march=athlon-xpAs mentioned in this thread: - CPUTYPE should be set with ?=, not - CFLAGS should be set with +=, not - Do not explicitly add -march or -mtune, use CPUTYPE exclusively - If you want -Os optimization, do not put -O2 in CFLAGS ...> cc -Os -fno-strict-aliasing -pipe -mtune=athlon-xp -march=athlon-xp > -march=athlon-xp -DPTHREAD_KERNEL -I/usr/src/lib/libthr/../libc/include > -I/usr/src/lib/libthr/thread -I/usr/src/lib/libthr/../../include > -I/usr/src/lib/libthr/arch/i386/include -I/usr/src/lib/libthr/sys > -I/usr/src/lib/libthr/../../libexec/rtld-elf > -I/usr/src/lib/libthr/../../libexec/rtld-elf/i386 > -I/usr/src/lib/libthr/../libthread_db -Winline -D_PTHREADS_INVARIANTS > -DSYSCALL_COMPAT -std=gnu99 -Wsystem-headers -Werror -Wall > -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign > -c /usr/src/lib/libthr/sys/thr_error.c cc -Os -fno-strict-aliasing -pipe > -mtune=athlon-xp -march=athlon-xp -march=athlon-xp -DPTHREAD_KERNEL > -I/usr/src/lib/libthr/../libc/include -I/usr/src/lib/libthr/thread > -I/usr/src/lib/libthr/../../include > -I/usr/src/lib/libthr/arch/i386/include -I/usr/src/lib/libthr/sys > -I/usr/src/lib/libthr/../../libexec/rtld-elf > -I/usr/src/lib/libthr/../../libexec/rtld-elf/i386 > -I/usr/src/lib/libthr/../libthread_db -Winline -D_PTHREADS_INVARIANTS > -DSYSCALL_COMPAT -std=gnu99 -Wsystem-headers -Werror -Wall > -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign > -c /usr/src/lib/libthr/thread/thr_affinity.c > cc1: warnings being treated as errors > /usr/src/lib/libthr/thread/thr_affinity.c: In function > '_pthread_setaffinity_np': /usr/src/lib/libthr/thread/thr_umtx.h:103: > warning: inlining failed in call to '_thr_umutex_unlock': --param > max-inline-insns-single limit reached > /usr/src/lib/libthr/thread/thr_affinity.c:56: warning: called from here > /usr/src/lib/libthr/thread/thr_umtx.h:103: warning: inlining failed in > call to '_thr_umutex_unlock': --param max-inline-insns-single limit > reached /usr/src/lib/libthr/thread/thr_affinity.c:64: warning: called > from here *** Error code 1Try building with NO_WERROR= in make.conf or src.conf. In this case, gcc is warning that it cannot inline some function, but that should not matter for the result.