This fixes the following error while compiling the toolchain:
ld: warning: ignoring duplicate libraries: '../libcpp/libcpp.a', '../libdecnumber/libdecnumber.a', 'libcommon.a'
ld: Undefined symbols:
_host_hooks, referenced from:
c_common_no_more_pch() in c-pch.o
gt_pch_save(__sFILE*) in libbackend.a[92](ggc-common.o)
gt_pch_save(__sFILE*) in libbackend.a[92](ggc-common.o)
gt_pch_restore(__sFILE*) in libbackend.a[92](ggc-common.o)
toplev::main(int, char**) in libbackend.a[252](toplev.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Previously the condition was for libraries that have relative linker libs,
but linker libs are not influencing libraries themselves, so the condition
was weird and there was no explanation why such functionality was
introduced.
Prior to this change, __aros_getbase_XXXX was used and was re-defined in
proto/xxxx.h to either library base of relative offset. However
__aros_getbase_XXXX was an actual function often used inside of library.
The effect was that if proto/xxxx.h was included in the library xxxx
itself, the __aros_getbase_XXXX was redefined, for example in per opener
library instead of reading R12 (x86_64 ABI) it was reading (local)
library base, causing struct Library *ABase = __aros__getbase_ABase() to
become struct Library *ABase = ABase and a "silent" NO-OP
This change changes the symbol used in library call to __LIB_LIBBASE and
__aros_getbase_XXXX is no longer re-defined in proto/xxxx.h
Additionally for cases there inline/xxxx.h or defines/xxxx.h is included
instead of proto/xxxx.h, __LIB_LIBBASE is defined to __aros_getbase_XXXX
so that proper implementation from linklib is pulled in. Same goes for
stub functions in "noincludes" case.
Note: this commit does not change client-side behavior as documented in
ABI_SPECIFICATION. It only changes the name of the symbol used.
This is needed for dwarf exception unwinding to work. Change was introduced
in GCC 4.8.3 patch on Feb 26, 2015. It was described as needed for
raspi/ARM. It is not known if this change is still needed.
TOOLDIR is specific to build, while CROSSTOOLSDIR can point to a shared,
external crosscompiler which then gets polluted with one builds output,
preventing another build to function.
For C++ code, removing sections with GROUP type and not unmarking
code sections "as part of group" was causing errors when loading
dbg files in gdb, nm, etc. Keep the sections to GROUP types as a
workaround.