[Mageia-dev] need some help to build a linuxsampler.rpm

PhilippeDidier philippedidier at laposte.net
Sun Sep 23 15:19:01 CEST 2012

Olivier Blin a écrit :
> PhilippeDidier <philippedidier at laposte.net> writes:
>> indeed the configured Makefile contains
>> LDFLAGS  option --as-needed htat worked for Mandriva !!!
>> I need now to write a patch for the makefiles...
>> to fix it in a better way than overriding LDFLAGS
>> May we now suppress the --as-needed option for LDFLAGS in every makefile ?
> No, you should not remove this option, this is the intended behavior.
> It just exposed a missing -l flag in the software you are packaging.
> The proper fix, as Thomas said, is to patch the Makefile to add the
> -lpthread flag where appropriate.
Hello !
Some news :
Indeed it was more difficult than I thought :
There were 21 different Makefile.in in 21 directories to modify :
I wrote a patch that replaces
+LDFLAGS = @LDFLAGS@ -lpthread
in each of them...

Now each Makefile contains :
LDFLAGS =  -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1
-Wl,--build-id -Wl,--enable-new-dtags -lpthread

And I discover that my first workaround was indeed bad :
I used
%make LDFLAGS="-lpthread"

instead of

this allowed to package and I felt happy ;) ... but wrongly happy :(

Now that I use a correct LDFLAGS I got new errors about other undefined
references (thanks to --as-needed option)
... and I feel sad :(

There came now undefined references to 'dlopen' 'dlerror' 'dlclose'

I had to add -ldl to each Makefile.in

And now it's OK

Thanks to all of you ! I'm now less ignorant than I was ...

But packaging for Mageia will need more skill and more time than for
Mandriva ... and more patches ! (hope it's worth of it)

I will provide my spec and patch files to anyone (perhaps through
bugzilla with a package request)


More information about the Mageia-dev mailing list