Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 358771 - dev-libs/openssl: CFLAGS/LDFLAGS sed breaks when they contain a colon
Summary: dev-libs/openssl: CFLAGS/LDFLAGS sed breaks when they contain a colon
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-14 01:50 UTC by Raffaello D. Di Napoli
Modified: 2011-03-18 20:20 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raffaello D. Di Napoli 2011-03-14 01:50:38 UTC
Currently it’s in dev-libs/openssl-1.0.0d, but I don’t know in which century this sed was introduced.
The line 2716 in src_configure:

sed -i -e "/^CFLAG/s:=.*:=${CFLAG} ${CFLAGS}:" -e "/^SHARED_LDFLAGS=/s:$: ${LDFLAGS}:" Makefile || die

dies if LDFLAGS from make.conf contains a “:”-separated path option (like -rpath-link), which causes sed to barf:
  sed: -e expression #2, char 179: unknown option to `s'

Of course the other oft-used delimiter “,” is out of question, since it’s used for -Wl . That’s probably the reason “:” was used in the first place.

I suggest using a character that nobody should have any reason to put in *FLAGS, such as pipe “|”.

Reproducible: Always
Comment 2 Raffaello D. Di Napoli 2011-03-16 05:42:18 UTC
Thanks for the fix.

(In reply to comment #1)
> presumably you're using a dumb system like OS X

# powerpc-unknown-linux-gnu-emerge --info
PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2'
Portage 2.1.9.25 (default/linux/powerpc/ppc32/10.0, gcc-4.4.5, glibc-2.11.3-r0, 2.6.36-gentoo-r5 i686)
=================================================================
System uname: Linux-2.6.36-gentoo-r5-i686-Intel-R-_Core-TM-2_Duo_CPU_T5550_@_1.83GHz-with-gentoo-2.0.1
Timestamp of tree: Tue, 15 Mar 2011 21:45:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r2, 3.1.3-r1
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.7.0
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.5
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="ppc"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -mcpu=603e -pipe -I/depot/chroot/PowerBook-3400c/work/include -I/depot/chroot/PowerBook-3400c/work/usr/include"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-Os -mcpu=603e -pipe -I/depot/chroot/PowerBook-3400c/work/include -I/depot/chroot/PowerBook-3400c/work/usr/include"
DISTDIR="/depot/portage/distfiles"
FEATURES="assume-digests binpkg-logs buildpkg distlocks fixlafiles fixpackages news nodoc noinfo noman parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-L/depot/chroot/PowerBook-3400c/work/lib -L/depot/chroot/PowerBook-3400c/work/usr/lib -Wl,-rpath-link,/depot/chroot/PowerBook-3400c/work/lib:/depot/chroot/PowerBook-3400c/work/usr/lib"
MAKEOPTS="-j1"
PKGDIR="/depot/chroot/PowerBook-3400c/pkg"
PORTAGE_CONFIGROOT="/depot/chroot/PowerBook-3400c/work/"
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="/var/lib/portage/tree"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X bzip2 cli cups cxx dri hfs iconv ipv6 minimal modules mudflap ncurses nptl nptlonly pcre ppc pppd readline session ssl symlink sysfs tcpd unicode xattr xorg zlib" ALSA_CARDS="powermac" 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="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="chips" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 SpanKY gentoo-dev 2011-03-16 19:14:07 UTC
ok, so your build flags are just stupid then
Comment 4 Raffaello D. Di Napoli 2011-03-16 20:59:56 UTC
(In reply to comment #3)
> ok, so your build flags are just stupid then

I’m sure you can certainly suggest something that works better and doesn’t involve “stupid flags”, right?
Comment 5 SpanKY gentoo-dev 2011-03-17 04:48:31 UTC
you should not be putting system paths into your compiler/linker flags.  this screws up things.  the toolchain itself should be able to find things on its own.
Comment 6 Raffaello D. Di Napoli 2011-03-17 14:36:43 UTC
(In reply to comment #5)
> you should not be putting system paths into your compiler/linker flags.  this
> screws up things.  the toolchain itself should be able to find things on its
> own.

Well, it’s not.

Firstly, I had to add the -I and -L flags because I’m in a ROOT != SYSROOT != / environment (cross-building out of cross-toolchain’s sysroot).

Then I had to add a bashrc that converts those pesky ld scripts (always diverting ld’s search path to /) into symlinks, which alone solved most of the configure and link errors I was getting.

Lastly, there were still several packages having problems (I forgot if it was during configure checking for libraries, or during the link phase of make all) from only checking sysroot and /, which went away when I added the -rpath-link hack.

That’s where I stand now. It may stink (and it does a lot, to me), but it works.
Now that I managed to emerge the whole @system, I’ll try removing the last hack and emerge -e @system, and this time maybe I’ll fix each individual package.
Comment 7 SpanKY gentoo-dev 2011-03-18 20:20:24 UTC
then you're simply doing it wrong.  ROOT is only for deployment, not for building.  SYSROOT is for building.