[BRLTTY] Honor distribution LDFLAGS when building drivers

Jaroslav Skarvada jskarvad at redhat.com
Tue Apr 24 16:49:13 EDT 2018



----- Original Message -----
> [quoted lines by Jaroslav Skarvada on 2018/04/24 at 11:55 -0400]
> 
> >there is the following downstream Fedora bugzilla [1] requesting
> >the drivers to be build with the distribution LDFLAGS.
> >
> >I used the attached hack to fix the problem, but I think it
> >should be also addressed upstream (probably more clean way)
> 
> Doesn't line 380 of configure.ac already do it?
> 
>    LDFLAGS_DYNAMIC="${LDFLAGS} BRLTTY_OPTIONS_LD2CC([${LDFLAGS_DYNAMIC}])"
> 

It didn't work for me. There is original build log:
https://kojipkgs.fedoraproject.org/packages/brltty/5.6/7.fc29/data/logs/x86_64/build.log

There is:
+ LDFLAGS='-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
+ export LDFLAGS

And later e.g. for the libbrlttybbg.so:
gcc -shared  -o ../../../lib/libbrlttybbg.so braille.o 

I.e. no LDFLAGS were applied.

The build log with the hack applied:
https://kojipkgs.fedoraproject.org/packages/brltty/5.6/8.fc29/data/logs/x86_64/build.log

There is:
gcc -shared -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-export-dynamic  -o ../../../lib/libbrlttybbg.so braille.o 

I.e. the flags were applied.

In the patch I had to use LDFLAGS_DYNAMIC, not just LDFLAGS,
because due to line 416 in the configure.ac:
LDFLAGS="${LDFLAGS} ${LDFLAGS_DYNAMIC}"

The original exported LDFLAGS got doubled

Jaroslav


More information about the BRLTTY mailing list