patchGNU Libtool - Patches: patch #9442, Add flang (LLVM-based compiler)...


You are not allowed to post comments on this tracker with your current authentication level.

patch #9442: Add flang (LLVM-based compiler) support

Submitter:  Gilles Gouaillardet <ggouaillardet>
Submitted:  Thu 24 Aug 2017 08:29:22 AM UTC
Votes: 25
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Thu 01 Feb 2024 07:30:50 AM UTC, comment #3: 

Seems this patch does not fully address the problem.

+ libtool --version
 libtool (GNU libtool)

For example, building hdf5 with the ARM compiler, with an MPI compiler wrapper
I still get this error:

flang: error: unknown argument: '-soname'

Looking at the libtool script produced by configure,
I still see empty wl=

11812 # The linker used to build libraries.
11813 LD="/bm/ashterenli/install/arm-compiler-for-linux_23.10_AmazonLinux-2/gcc-12.2.0_AmazonLinux-2/aarch64-linux-gnu/bin/ld"
11815 # How to create reloadable object files.
11816 reload_flag=" -r"
11817 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
11819 # Commands used to build an old-style archive.
11820 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
11822 # A language specific compiler.
11823 CC="ftn"
11825 # Is the compiler the GNU compiler?
11826 with_gcc=no
11828 # Compiler flag to turn off builtin functions.
11829 no_builtin_flag=""
11831 # Additional compiler flags for building library objects.
11832 pic_flag=""
11834 # How to pass a linker flag through the compiler.
11835 wl=""  

And I still have to fix the libtool script with:

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

which I got from:

Sun 14 Jan 2024 07:16:15 AM UTC, comment #2: 

This should be checking for flang to also match for the current name of flang-new, though hopefully for LLVM 18 that'll change to flang, but not yet.

Brad Smith <brad0>
Sun 14 Jan 2024 07:09:37 AM UTC, comment #1: 

i dropped the -DPIC part as no other target does it, and i think we handle that in common code already.  feel free to follow up if you disagree.

Mike Frysinger <vapier>
Group Member
Thu 24 Aug 2017 08:29:22 AM UTC, original submission:  

This patch adds support for flang compilers. Some specific flags are needed so these compilers must be handled in a specific way.
By default, the compiler is called 'flang', but ARM releases their own flang-based compiler called 'armflang'.

Because of the current lack of flang support in libtool, the generated 'libtool' must be manually modified after 'configure' is invoked. Such a process is for example described on ARM web site (it involves the Open MPI library) at

Gilles Gouaillardet <ggouaillardet>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #41640:  flang.patch added by ggouaillardet (890B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by ashterenli (Posted a comment)
  • -email is unavailable- added by brad0 (Posted a comment)
  • -email is unavailable- added by vapier (Posted a comment)
  • -email is unavailable- added by nsircombe (Voted in favor of this item)
  • -email is unavailable- added by ggouaillardet (Submitted the item)

    There are 25 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-14 vapier StatusNone Done
        Open/ClosedOpen Closed
    2018-09-25 nsircombe Carbon-Copy- Added nsircombe
    2017-08-24 ggouaillardet Attached File- Added flang.patch, #41640

    Back to the top

    Powered by Savane 3.13-0159.
    Corresponding source code