AdaCore / gprbuild

GPRbuild is an advanced build system designed to help automate the construction of multi-language systems.
Other
65 stars 21 forks source link

-largs is ignored when linking libraries #69

Closed Earnestly closed 1 year ago

Earnestly commented 4 years ago

I'm unable to use gprbuild as it ignores my required -largs and I am unable to provide a gprconfig xml snippet, .cgpr, etc. that works for both executables and libraries.

It would be nice if gprbuild honoured -largs as gnatmake does for both libraries and executables.

t-14 commented 4 years ago

Thanks for the report. IIRC there were reasons why -largs are ignored for libraries, that may or may not be [any longer] pertinent. We'll dig.

Blady-Com commented 4 years ago

Hello, I've the same behaviour with:

$ gprbuild -Pgnatcoll_gmp.gpr --target=x86_64-darwin -XGNATCOLL_OS=osx -XBUILD=PROD -XGNATCOLL_VERSION=0.0 -XLIBRARY_TYPE=relocatable -XGPR_BUILD=relocatable -XXMLADA_BUILD=relocatable -largs -L/usr/local/xnadalib-2019/lib
Build Libraries
   [gprlib]       gnatcoll_gmp.lexch
   [link library] libgnatcoll_gmp.dylib
ld: library not found for -lgmp
collect2: error: ld returned 1 exit status
gprlib: /usr/local/adacore/2019/bin/gcc execution error
gprbuild: could not build library for project gnatcoll_gmp

"-L/usr/local/xnadalib-2019/lib" is not taken in account in gcc args. HTH, Pascal.

t-14 commented 4 years ago

When all you need is a -L switch you can just set LIBRARY_PATH.

Earnestly commented 4 years ago

Unfortunately the -largs I need are not -L libraries.

t-14 commented 4 years ago

Right. That's why I didn't suggest this workaround to you ;)

Earnestly commented 4 years ago

However I didn't specify any linker flags. As you didn't explicitly address either person, it was only reasonable to explain how this isn't applicable in my case. No need for the aggressive banality ";)"

t-14 commented 4 years ago

I did explicitly answer to YOU that we will look into this, and also I didn't close the issue, so you really had no reason to think that I consider that my comment answers it for you. No need to lecture me on the aggressivity of a wink smiley.

Blady-Com commented 4 years ago

When all you need is a -L switch you can just set LIBRARY_PATH.

Thanks Vasiliy, it makes the job. Though, it'd be nice to have a gprbuild property for relocatable build as it exists for static build.

Earnestly commented 4 years ago

The resolution of this issue is no longer relevant to me. Reopen if necessary.

Xiretza commented 4 years ago

@Earnestly still an issue, please reopen. @t-14 did you get anywhere with your digging?

Earnestly commented 4 years ago

Reopening on request.

t-14 commented 3 years ago

@t-14 did you get anywhere with your digging?

We are inclined to make a change for Linker'Linker_Options and -largs to be taken into account when building shared libraries.

Xiretza commented 2 years ago

Any update on this?

t-14 commented 2 years ago

It's on our list.