libgcrypt fails to build if a dir contains -O

64 views
Skip to first unread message

Ondrej Certik

unread,
Jul 14, 2009, 9:32:49 PM7/14/09
to sage-...@googlegroups.com, spd...@googlegroups.com
Hi,

there is a serious bug in the libgcrypt buildsystem. I moved the
source directory from "femhub-0.9.5" to "femhub-0.9.5-OSX" and it
failed here:

[...]
gcc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src
-I/Users/ondrej/ext/femhub-0.9.5-OSX/local/include
-I/Users/ondrej/ext/femhub-0.9.5-OSX/local/include -g -O2 -Wall
-Wpointer-arith -MT sha512.lo -MD -MP -MF .deps/sha512.Tpo -c sha512.c
-o sha512.o >/dev/null 2>&1
mv -f .deps/sha512.Tpo .deps/sha512.Plo
`echo /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H
-I. -I.. -I../src -I../src
-I/Users/ondrej/ext/femhub-0.9.5-OSX/local/include
-I/Users/ondrej/ext/femhub-0.9.5-OSX/local/include -g -O2 -Wall
-Wpointer-arith -c ./tiger.c | sed -e 's/-O[2-9s]*/-O1/g' `
gcc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src
-I/Users/ondrej/ext/femhub-0.9.5-O1SX/local/include
-I/Users/ondrej/ext/femhub-0.9.5-O1SX/local/include -g -O1 -Wall
-Wpointer-arith -c ./tiger.c -fno-common -DPIC -o .libs/tiger.o
In file included from ../src/visibility.h:245,
from ../src/g10lib.h:39,
from ./tiger.c:26:
../src/gcrypt.h:29:23: error: gpg-error.h: No such file or directory

And I said to myself, nonono, that's not possible, I just tried the
whole build and it worked, I made a new release of femhub and now it
fails while uploading final binaries!
Looking more closely, I noticed the crappy path "femhub-0.9.5-O1SX", I
thought I had something on my monitor first (e.g. the "1"). But then I
noticed this crappy code:

sed -e 's/-O[2-9s]*/-O1/g'

above. No wonder it fails...

Running this on the source directory of libgcrypt,

$ grep "sed -e 's" * | wc -l
172

reveals that the upstream guys really love sed. :)

Is here anyone more familiar with libgcrypt and it's buildsystem? The
above "sed" fix seems like some hotfix for some bug in the buildsystem
to me.

Ondrej

William Stein

unread,
Jul 14, 2009, 10:46:07 PM7/14/09
to spd...@googlegroups.com

Before you do anything else, it might be worth trying with
libgcrypt-1.4.4, since the version in Sage is out of date (it's
1.4.3).
Get it here:

http://www.gnupg.org/download/#libgcrypt

And obviously it would be nice if you posted an upgraded spkg to trac :-)

William

Ondrej Certik

unread,
Jul 14, 2009, 11:05:20 PM7/14/09
to spd...@googlegroups.com

I just tested 1.4.4 and the bug is still there. So we should report it
upstream. I guess here:

https://bugs.g10code.com/gnupg/index

I guess a fix will be to add one space to that "sed" line, before -O,
but so far I didn't manage to find the place where it is being called.

Ondrej

William Stein

unread,
Jul 15, 2009, 2:07:00 AM7/15/09
to spd...@googlegroups.com

And an absolutely bare minimum, we can add something to the beginning
of the build system or to the spkg that checks if "-O" is in the
directory name, and if so, immediately stops with a message about this
bug.

William

Reply all
Reply to author
Forward
0 new messages