When I tried emerging unison, it requires ocaml, which started compiling everything with "-O" (my CFLAGS were NOT appended to the compile commands). This breaks other things for me .. Reproducible: Always Steps to Reproduce: 1. Set CFLAGS to "-Os", etc. 2. emerge unison 3. unison requires ocaml, which then gets emerged Actual Results: . . gcc -O -fno-defer-pop -Wall -Wno-unused -D_FILE_OFFSET_BITS=64 -D_REENTRANT - c -o hash.o hash.c gcc -O -fno-defer-pop -Wall -Wno-unused -D_FILE_OFFSET_BITS=64 -D_REENTRANT - c -o sys.o sys.c gcc -O -fno-defer-pop -Wall -Wno-unused -D_FILE_OFFSET_BITS=64 -D_REENTRANT - c -o meta.o meta.c . . Expected Results: It should have appended my CFLAGS to the compile commands. # emerge info Portage 2.0.50-r6 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3_pre20040420-r0, 2.6.5-gentoo-r1) ================================================================= System uname: 2.6.5-gentoo-r1 i686 VIA Samuel 2 Gentoo Base System version 1.4.12 Autoconf: sys-devel/autoconf-2.59-r3 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-no-integrated-cpp -fforce-addr -fstack-protector-all -Os -march=i586 - m3dnow -mmmx" CHOST="i586-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/ config /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-no-integrated-cpp -fforce-addr -fstack-protector-all -Os - march=i586 -m3dnow -mmmx" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs gb_cc noclean strict userpriv" GENTOO_MIRRORS="ftp://mirror.iawnet.sandia.gov/pub/gentoo/ ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://gentoo.chem.wisc.edu/gentoo/ ftp://gentoo.chem.wisc.edu/gentoo/ http://mirror.clarkson.edu/pub/distributions/gentoo/" MAKEOPTS="-j1" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow acl adns apache2 apm bindist crypt curl directfb doc ethereal fastcgi fbcon gb gbphp gd gd-external gdbm ggi gif gpm innodb jikes jpeg libg++ libwww maildir mcal memlimit mmx mpi mysql ncurses nptl pam pdflib perl php pie plotutils png prelude python readline slang spell sse ssl svga tcpd tiff truetype usb x86 xml2 zlib"
The ocaml compiler has a configure script that is devoted to setting the right options for gcc on the different arches and does not accept any flag to set particular CFLAGS. I asked on the list why it is so and got no response, which i can interpret as 'we do not support other CFLAGS than ours'. This is quite sensible given how the native compilation is fine-tuned in ocaml and repose on gcc options. I can't fix it, changing the Makefiles etc.., as if I do that I won't be able to ask for support or submit bug reports on ocaml anymore.
Well, right now ocaml will break for any systems requiring ABI flags, it will break crossbuilding and it will break GRP. Ignoring CFLAGS isn't a valid solution.
Ok, i added support for CFLAGS in ocaml-3.07-r1 and ocaml-3.08 with a warning in pkg_setup() about unsafe flags and unexpected bugs. Now it will not ignore -Os so i close this bug.