View Issue Details

IDProjectCategoryView StatusLast Update
0003006OpenFOAMPatchpublic2018-07-17 23:09
ReporterakidessAssigned Tohenry 
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
PlatformLinux 2.6.32-573.51.1.el6.x86_64OSOtherOS Version(please specify)
Product Versiondev 
Fixed in Versiondev 
Summary0003006: Tweak wmake rules to avoid ld.gold linker issues
DescriptionIt is known that OpenFOAM cannot be built using the ld.gold linker. This can be remedied by patching the wmake rules by adding the -fuse-ld=bfd option to LINKEXE (c,c++) and LINKLIBSO (c).

At the very least I think it may be useful to link to this comment in the old issue. If you don't see adverse effects, it may be a good idea to include the change in the official source.
Additional InformationRelates to issue 685:
https://bugs.openfoam.org/view.php?id=685
TagsNo tags attached.

Activities

henry

2018-07-17 10:29

manager   ~0009854

Do you know if this additional linker option cause problems for the bfd linker, other compilers or gcc versions? Is it only needed for gcc or also clang and icpc?

akidess

2018-07-17 12:01

reporter   ~0009857

At least in V18, ICC/ICPC support the fuse-ld flag for compatibility with GCC [1].

LLVM also implemented the flag for compatibility in 2014 [2]. Since I've never used Clang/LLVM, I cannot judge if you'd want to use bfd or rather the native LLD linker.

Since wmake allows specifying rules for every compiler, I would only suggest adding the fuse-ld=bfd option for GCC. I'll try to find out when the flag was implemented for GCC (for which version), and update this report.

[1] https://software.intel.com/en-us/cpp-compiler-18.0-developer-guide-and-reference-fuse-ld
[2] https://reviews.llvm.org/D4295

akidess

2018-07-17 12:29

reporter   ~0009858

The patch to include the flag was included in GCC 4.8.0 [1], so it fits the already present build requirements for OpenFOAM.

[1] https://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html

I thus see no risk in including the change in the wmake options for GCC, without touching the LLVM and ICC options until someone can confirm the issue manifests itself with those compilers as well.

henry

2018-07-17 14:58

manager   ~0009860

> adding the -fuse-ld=bfd option to LINKEXE (c,c++) and LINKLIBSO (c).

Why should the option be added to LINKLIBSO of c and not c++?

akidess

2018-07-17 19:45

reporter   ~0009862

No reason, I just overlooked the LINKLIBSO entry there. So indeed the option should be added for both LINKEXE and LINKLIBSO for both c and c++.

henry

2018-07-17 23:09

manager   ~0009863

Resolved by commit 5e8593c1716490a4e74fe8136c248257123aa255

Issue History

Date Modified Username Field Change
2018-07-12 21:08 akidess New Issue
2018-07-17 10:29 henry Note Added: 0009854
2018-07-17 12:01 akidess Note Added: 0009857
2018-07-17 12:29 akidess Note Added: 0009858
2018-07-17 14:58 henry Note Added: 0009860
2018-07-17 19:45 akidess Note Added: 0009862
2018-07-17 23:09 henry Assigned To => henry
2018-07-17 23:09 henry Status new => resolved
2018-07-17 23:09 henry Resolution open => fixed
2018-07-17 23:09 henry Fixed in Version => dev
2018-07-17 23:09 henry Note Added: 0009863