aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2025-01-28 16:14:35 +0000
committerRichard Earnshaw <rearnsha@arm.com>2025-01-28 16:23:06 +0000
commit0204dcf930b5093d0811a007b7f47aa42e55e787 (patch)
tree26746ed7184a1cbb9339ea03389d2602086d2e0e /libgcc
parent54bdeca3c6214485d15454df30183a56ad3e473b (diff)
downloadgcc-0204dcf930b5093d0811a007b7f47aa42e55e787.zip
gcc-0204dcf930b5093d0811a007b7f47aa42e55e787.tar.gz
gcc-0204dcf930b5093d0811a007b7f47aa42e55e787.tar.bz2
arm: libgcc: make -spec=sync-*.specs compatible with LTO [PR118642]
The arm-none-eabi port provides some alternative implementations of __sync_synchronize for different implementations of the architecture. These can be selected using one of -specs=sync-{none,dmb,cp15dmb}.specs. These specs fragments fail, however, when LTO is used because they unconditionally add a --defsym=__sync_synchronize=<implementation> to the linker arguments and that fails if libgcc is not added to the list of libraries. Fix this by only adding the defsym if libgcc will be passed to the linker. libgcc/ PR target/118642 * config/arm/sync-none.specs (link): Only add the defsym if libgcc will be used. * config/arm/sync-dmb.specs: Likewise. * config/arm/sync-cp15dmb.specs: Likewise.
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/config/arm/sync-cp15dmb.specs2
-rw-r--r--libgcc/config/arm/sync-dmb.specs2
-rw-r--r--libgcc/config/arm/sync-none.specs2
3 files changed, 3 insertions, 3 deletions
diff --git a/libgcc/config/arm/sync-cp15dmb.specs b/libgcc/config/arm/sync-cp15dmb.specs
index 0bb64b9..47bf68b 100644
--- a/libgcc/config/arm/sync-cp15dmb.specs
+++ b/libgcc/config/arm/sync-cp15dmb.specs
@@ -1,4 +1,4 @@
%rename link sync_sync_link
*link:
---defsym=__sync_synchronize=__sync_synchronize_cp15dmb %(sync_sync_link)
+%{!nostdlib|lgcc: --defsym=__sync_synchronize=__sync_synchronize_cp15dmb} %(sync_sync_link)
diff --git a/libgcc/config/arm/sync-dmb.specs b/libgcc/config/arm/sync-dmb.specs
index 13e59bd..cadad6d 100644
--- a/libgcc/config/arm/sync-dmb.specs
+++ b/libgcc/config/arm/sync-dmb.specs
@@ -1,4 +1,4 @@
%rename link sync_sync_link
*link:
---defsym=__sync_synchronize=__sync_synchronize_dmb %(sync_sync_link)
+%{!nostdlib|lgcc: --defsym=__sync_synchronize=__sync_synchronize_dmb} %(sync_sync_link)
diff --git a/libgcc/config/arm/sync-none.specs b/libgcc/config/arm/sync-none.specs
index 0aa4960..46071ca 100644
--- a/libgcc/config/arm/sync-none.specs
+++ b/libgcc/config/arm/sync-none.specs
@@ -1,4 +1,4 @@
%rename link sync_sync_link
*link:
---defsym=__sync_synchronize=__sync_synchronize_none %(sync_sync_link)
+%{!nostdlib|lgcc: --defsym=__sync_synchronize=__sync_synchronize_none} %(sync_sync_link)