Created attachment 57 [details] patch to modify the LDFLAGS in one makefile (adding explicit links) Hello ! I used to use Linuxsampler in a Mandriva distribution (a rpm was built for it) I tried to import Linuxsampler into Mageia (a Mandriva fork) and to build a rpm but I encountered a little problem : Samely as in some other distributions, Mageia developpers choosed to disable the --as needed option by default in LDFLAGS to prevent from overlinking or underlinking so : when I "make" I get error messages complaining for undefined references 1°) I first used the official linuxsampler-1.0.0.tar.bz2 and applied a patch file that I add as attachment just below : It adds explicit LDFLAGS -lpthread -ldl into ./src/Makefile.in 2°) I then used the last svn tar for each part of the linuxsampler project (gig, gigedit, liblscp, qsampler) I have to command first : make -f Makefile.cvs (or make -f Makefile.svn ) with the downloaded svn tree (to create the Makefile.in in each directory) then I need to add these explicit LDFLAGS -lpthread -ldl -llscp -ly in ./src/Makefile.in and in ./src/network/Makefile.in (I will provide the patch file in the next comment) I didn't find an other way to add these LDFLAGS only in these two Makefiles (I could for instance type %make LDFLAGS="-lpthread" but I will do overlinking) There's perhaps something you can modify somewhere in the source to protect the packagers from this link problem... Hope this will help Regards Philippe
Created attachment 58 [details] patch to modify the LDFLAGS in two makefiles for svn2372 (adding explicit links)
Nota Bene : This patch is only needed for Linuxsampler ... neither for gig, nor gigedit, nor liblscp ,nor qsampler
I tried to reproduce this error, by setting LDFLAGS="-Wl,--as-needed" in my configure command for libgig and linuxsampler, but I failed. Everything built without errors. What are the steps to reproduce the problem? It shouldn't be necessary to build an rpm should it? I'm using Mageia 2.
OK, it's not the --as-needed linker option that causes the problem, it's --no-undefined. (And Mageia's rpm system uses both). With LDFLAGS="-Wl,--no-undefined" I got a lot of undefined reference errors to pthreads and dl.
I don't understand why you needed to add more libs just because you moved from 1.0.0 to svn. The lscp lib isn't used at all by linuxsampler, and liby has never been required I think. At least the problem I could reproduce (and I'm using svn latest) is fixed by simply appending "-lpthread -ldl" to liblinuxsampler_la_LIBADD in src/Makefile.am. Can you please try if that solves your problem too?
(En réponse au commentaire 5) > I don't understand why you needed to add more libs just because you moved from > 1.0.0 to svn. The lscp lib isn't used at all by linuxsampler, and liby has > never been required I think. > > At least the problem I could reproduce (and I'm using svn latest) is fixed by > simply appending "-lpthread -ldl" to liblinuxsampler_la_LIBADD in > src/Makefile.am. Can you please try if that solves your problem too? Hello Andreas You're absolutely right ... and twice right : 1) it's indeed --no-undefined option that causes the problem (--as-needed allows to know what library is needed when --no-undefined option is used... but not to use them...) 2) I just added "-lpthread -ldl" to liblinuxsampler_la_LIBADD in src/Makefile.am and everything works fine with the svn version (no need for ly nor llscp) I just add the modified patch for svn Thanks
Created attachment 59 [details] patch to add explicit LDFLAGS in /src/makefile.am for svn2372
Thanks for the modification in /src/makefile.am (svn 2378) it's OK now ! No problem in Mageia... Reagards Philippe