On 26/06/2024 10:21, Shterenlikht, Anton wrote:
Please help understand and fix this problem:

libtool: link: ftn -shared   <skip files>  -soname libxxx.so.0 -o 
.libs/libxxx.so.0.0.0
clang-16: error: unknown argument: '-soname'

which comes from my compiler wrapper not recognised.

Sorry for missing your earlier response. To set 'wl' for
flang, armflang, flang-new, and ftn, the following patch
should work:

--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@@ -4805,7 -4805,7 +4805,7 @@@ m4_if([$1], [CXX],
        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
        _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
          ;;
--      *flang)
++      *flang* | ftn*)
          # Flang compiler.
        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'

Could you test this again in your environment?

The libtool script generated for my project has:

# A language specific compiler.
CC="ftn"

# Is the compiler the GNU compiler?
with_gcc=no

# Compiler flag to turn off builtin functions.
no_builtin_flag=""

# Additional compiler flags for building library objects.
pic_flag=""

# How to pass a linker flag through the compiler.
wl=""

I can fix this with

sed -i -e 's/wl=""/wl="-Wl,"/g' libtool

as I reported in https://savannah.gnu.org/patch/?9442

However, what is the right way to deal with this?

Finally, will the patch from https://savannah.gnu.org/patch/?9442
be included in the upcoming libtool release?

The previous patch was applied in the latest alpha release of
libtool 2.5.0, and you should see it in the upcoming beta and
stable releases.

Thank you

Anton

--
Ileana Dumitrescu

GPG Public Key: FA26 CA78 4BE1 8892 7F22 B99F 6570 EA01 146F 7354

Attachment: OpenPGP_0x6570EA01146F7354.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to