Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 374801 - dev-db/redis fails with forced --as-needed
Summary: dev-db/redis fails with forced --as-needed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Highest QA
Assignee: Robin Johnson
URL: http://www.gentoo.org/proj/en/qa/asne...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-11 09:14 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2011-08-15 00:30 UTC (History)
2 users (show)

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


Attachments
Build log (redis-2.2.11:20110710-025854.log,11.73 KB, text/plain)
2011-07-11 09:14 UTC, Diego Elio Pettenò (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2011-07-11 09:14:27 UTC
Created attachment 279729 [details]
Build log

I'm reporting this bug because the package in summary fails to build when forcing --as-needed on through spec files (check out http://blog.flameeyes.eu/2008/11/14/problems-and-mitigation-strategies-for-as-needed for details).

Please note that this bug _might_ apply to -Wl,--as-needed in LDFLAGS as well; in both cases it should be fixed. Also, if this is due to the package in question not respecting user-defined LDFLAGS, you should get to fix that too.

Check the attached build log.

Thanks,
Diego
Comment 1 Johan Bergström 2011-07-11 11:21:45 UTC
Hello!

Before digging into this, I looked at HEAD from github. It now incorporates a static jemalloc and won't be fun to work with :( Anyway. Onwards to action.

(In reply to comment #0)
> Created attachment 279729 [details]
> Build log
> 
> I'm reporting this bug because the package in summary fails to build when
> forcing --as-needed on through spec files (check out
> http://blog.flameeyes.eu/2008/11/14/problems-and-mitigation-strategies-for-as-needed
> for details).

I'm unable to reproduce this on my x86_64 (gcc-4.5.2) through specfiles. Linking works as intended:
make[2]: Leaving directory `/var/tmp/portage/dev-db/redis-2.2.11/work/redis-2.2.11/deps/hiredis'
x86_64-pc-linux-gnu-gcc -o redis-benchmark -std=c99 -pedantic -Wall -W -D__EXTENSIONS__ -D_XPG6 -O2 -pipe -lm -pthread   -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu ae.o anet.o redis-benchmark.o sds.o adlist.o zmalloc.o ../deps/hiredis/libhiredis.a
x86_64-pc-linux-gnu-gcc -o redis-cli -std=c99 -pedantic -Wall -W -D__EXTENSIONS__ -D_XPG6 -O2 -pipe -lm -pthread   -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu anet.o sds.o adlist.o redis-cli.o zmalloc.o release.o ../deps/hiredis/libhiredis.a ../deps/linenoise/linenoise.o
x86_64-pc-linux-gnu-gcc -o redis-check-dump -std=c99 -pedantic -Wall -W -D__EXTENSIONS__ -D_XPG6 -O2 -pipe -lm -pthread   -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu redis-check-dump.o lzf_c.o lzf_d.o
x86_64-pc-linux-gnu-gcc -o redis-check-aof -std=c99 -pedantic -Wall -W -D__EXTENSIONS__ -D_XPG6 -O2 -pipe -lm -pthread   -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu redis-check-aof.o
x86_64-pc-linux-gnu-gcc -o redis-server -std=c99 -pedantic -Wall -W -D__EXTENSIONS__ -D_XPG6 -O2 -pipe -lm -pthread   -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o vm.o pubsub.o multi.o debug.o sort.o intset.o syncio.o


> 
> Please note that this bug _might_ apply to -Wl,--as-needed in LDFLAGS as well;
> in both cases it should be fixed. Also, if this is due to the package in
> question not respecting user-defined LDFLAGS, you should get to fix that too.

The ebuild is respecting user-defined LDFLAGS, I confirmed this by changing them in my /etc/make.conf. Linking with --as-needed works from here as well.

> 
> Check the attached build log.
> 
> Thanks,
> Diego

Thanks for the input. Is this perhaps 32-bit only? 
I've got a 32bit image tucked away, will give it a try later on.
Comment 2 Johan Bergström 2011-07-12 08:01:29 UTC
FYI: This is 32-bit only, and adding -m32 to ARCH (TARCH) doesn't help (this is how upstream wants you to build 32 bit builds).

I'll have a closer look at this shortly, but we should file a bug upstream.
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-07-12 08:11:17 UTC
This is *not* 32-bit only, it is *forced* --as-needed only.

You got -lm passed _before_ the LDFLAGS, so if you simply have -Wl,--as-needed in LDFLAGS, it won't apply to -lm. OTOH with forced --as-needed, -lm is discarded as well.
Comment 4 Johan Bergström 2011-07-18 18:46:18 UTC
(In reply to comment #3)
> This is *not* 32-bit only, it is *forced* --as-needed only.
> 
> You got -lm passed _before_ the LDFLAGS, so if you simply have -Wl,--as-needed
> in LDFLAGS, it won't apply to -lm. OTOH with forced --as-needed, -lm is
> discarded as well.

What I meant was that I was only able to reproduce with *forced* --as-needed on my 32-bit install, not the 64-bit one.
Comment 5 Johan Bergström 2011-07-28 18:50:24 UTC
FYI: Same error on 2.2.12.

Diego: Could you perhaps file an upstream bug? I read your comment as me walking in the dark, so I'd appreciate if you could post proper details so upstream tackles the issue correctly. Thanks!
Comment 6 Johan Bergström 2011-07-29 10:51:52 UTC
Upstream issue here: http://code.google.com/p/redis/issues/detail?id=615

Please comment if I'm giving misleading information.
Comment 7 Johan Bergström 2011-08-13 19:22:24 UTC
Guess I should mention that this was fixed upstream some weeks ago.  Commit for 2.2 brand found here: https://github.com/antirez/redis/commit/e1f01c9b28751d71ba0df682fb0f6b62f4db9191
Comment 8 Luca Barbato gentoo-dev 2011-08-15 00:30:49 UTC
I updated to the .12 and added the patch, thanks for the notice.