Summary: | dev-lang/ocaml: fail to build with pie enabled gcc. | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Hongjiu Zhang <voidprayer> |
Component: | Current packages | Assignee: | Gentoo Team for the ML programming language family <ml> |
Status: | RESOLVED OBSOLETE | ||
Severity: | normal | CC: | gienah, hardened, luckyluke, mike, pchrist |
Priority: | High | Flags: | sping:
Bugday+
|
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Full build.log |
Description
Hongjiu Zhang
2009-12-31 08:28:59 UTC
Created attachment 214703 [details]
Full build.log
The compiler hit a check for -pg and -pie in the gcc spec for -pg mess up the hardened start and endfiles when linking. A filter-flags -pie in the ebuild should fix tht error. I've tried adding a "filter-flags -pie", directly after the "append-ldflags -nopie", but it's made no difference. Neither has the newer version in portage. It builds fine with the stable hardened gcc (4.3.4), but with gcc-4.4.2-r2 from the hardened-dev overlay it won't. x86_64-pc-linux-gnu-gcc -c -DSYS_linux -o amd64.o amd64.S || \ { echo "If your assembler produced syntax errors, it is probably unhappy with the"; echo "preprocessor. Check your assembler, or try producing amd64.o by hand."; exit 2; } rm -f libasmrun.a ar rc libasmrun.a startup.o main.o fail.o roots.o globroots.o signals.o signals_asm.o misc.o freelist.o major_gc.o minor_gc.o memory.o alloc.o compare.o ints.o floats.o str.o array.o io.o extern.o intern.o hash.o sys.o parsing.o gc_ctrl.o terminfo.o md5.o obj.o lexing.o printexc.o callback.o weak.o compact.o finalise.o custom.o unix.o backtrace.o natdynlink.o amd64.o ranlib libasmrun.a x86_64-pc-linux-gnu-gcc -c -I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_amd64 -DSYS_linux -pg -O -DPROFILING -march=opteron -O2 -pipe -D_FILE_OFFSET_BITS=64 -D_REENTRANT startup.c x86_64-pc-linux-gnu-gcc: -pie and -pg|p|profile are incompatible make[2]: *** [startup.p.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/dev-lang/ocaml-3.11.1/work/ocaml-3.11.1/asmrun' make[1]: *** [runtimeopt] Error 2 make[1]: Leaving directory `/var/tmp/portage/dev-lang/ocaml-3.11.1/work/ocaml-3.11.1' make: *** [opt] Error 2 Portage 2.1.6.13 (hardened/linux/amd64/10.0, gcc-4.4.2, glibc-2.10.1-r1, 2.6.21-xen x86_64) ================================================================= System uname: Linux-2.6.21-xen-x86_64-Dual-Core_AMD_Opteron-tm-_Processor_2214-with-gentoo-1.12.13 Timestamp of tree: Sun, 24 Jan 2010 19:00:01 +0000 ccache version 2.4 [disabled] app-shells/bash: 4.0_p35 dev-java/java-config: 2.1.9-r2 dev-lang/python: 2.6.4 dev-util/ccache: 2.4-r7 dev-util/cmake: 2.6.4-r3 sys-apps/baselayout: 1.12.13 sys-apps/sandbox: 1.6-r2 sys-devel/autoconf: 2.63-r1 sys-devel/automake: 1.9.6-r2, 1.10.2 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6b virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=opteron -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /var/bind /var/qmail/alias /var/qmail/control" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-march=opteron -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="buildpkg distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LDFLAGS="-Wl,-O1" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages/opteron" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local/layman/comodo /usr/portage/local/layman/hardened-development" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="acl amd64 apache2 bash-completion berkdb bzip2 calendar ccache cgi cjk cli cracklib crypt ctype curl cxx dbm dri expat extraengine fastcgi flv force-cgi-redirect ftp gd gdbm gencertdaily geoip gmp gocr gpm hardened hash hpn hvm iconv idn imagemagick imap ioemu iproute2 ipv6 ithreads jpeg json justify ldap ldirectord logrotate logwatch lvm math memlimit mmx modules mpm-worker mudflap multilib mysql mysqli ncurses nls noauthcram nptl nptlonly ocrad odbc openct openmp pam pcre pdo perl pic png posix postgres pppd pygrub python readline reflection restrict rsync ruby screen server session simplexml smartcard snmp soap sockets spell spl sqlite sse sse2 ssl static-gzip status subversion svg sysfs tcpd tesseract threads tidy tiff tokenizer truetype unicode urandom usb vhosts xattr xen xml xmlreader xmlrpc xmlwriter xorg xsl zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="alias auth_basic auth_digest authn_alias authn_anon authn_default authn_file authz_groupfile authz_host authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_connect proxy_http rewrite setenvif so status unique_id usertrack" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa via vmware voodoo" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS Adding filter-flags -fPIE to the ebuild before the append-ldflags -nopie works fine for me. laptop1 / # emerge --info Portage 2.2_rc62 (hardened/linux/amd64/10.0, gcc-4.4.3, glibc-2.11-r0, 2.6.32-gentoo-r3 x86_64) ================================================================= System uname: Linux-2.6.32-gentoo-r3-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T7700_@_2.40GHz-with-gentoo-2.0.1 Timestamp of tree: Wed, 31 Mar 2010 13:15:01 +0000 ccache version 2.4 [disabled] app-shells/bash: 4.0_p33 dev-java/java-config: 2.1.9-r1 dev-lang/python: 2.5.4-r3, 2.6.3, 3.1.1-r1 dev-util/ccache: 2.4-r8 dev-util/cmake: 2.6.4-r3 sys-apps/baselayout: 2.0.1 sys-apps/openrc: 0.5.1-r1 sys-apps/sandbox: 2.2 sys-devel/autoconf: 2.13, 2.63-r1 sys-devel/automake: 1.5, 1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11 sys-devel/binutils: 2.20 sys-devel/gcc: 3.4.6-r2, 4.3.4-r2, 4.4.3 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6b virtual/os-headers: 2.6.30-r1 (In reply to comment #3) > x86_64-pc-linux-gnu-gcc -c -I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE > -DTARGET_amd64 -DSYS_linux -pg -O -DPROFILING -march=opteron -O2 -pipe > -D_FILE_OFFSET_BITS=64 -D_REENTRANT startup.c > x86_64-pc-linux-gnu-gcc: -pie and -pg|p|profile are incompatible I see no -pie here so that's probably your gcc specs that are broken because of that new check, these should be updated and are not related to ocaml. (In reply to comment #5) > I see no -pie here so that's probably your gcc specs that are broken because of > that new check, these should be updated and are not related to ocaml. > Eh, you should still filter pie in cflags, because both GCC and ld assumes that pic/pie is used both while compiling and linking, else unexpected behaviours can appere (textrels on x86 and failing compilation on amd64). Currently I cannot make this build on my amd64 system without filtering pie from cflags (and the same seems to go for zorry). (In reply to comment #3) > I've tried adding a "filter-flags -pie", directly after the "append-ldflags > -nopie", but it's made no difference. > Neither has the newer version in portage. > When did you last resync your portage tree and your overlay and have you retried since that? It should work now with the new updated pie patches and specs in the overlay. Probably
ocaml-4.02.1.ebuild
37c37
< append-ldflags -nopie
---
> append-cflags -nopie
This should be fine now. Let us know if it's not. |