Skip to content

Commit 35caaed

Browse files
committed
arch/_common_switches: add -latomic switch
Adding this switch saves all ab_match_arch occurrences that manually adds '-latomic' to compiler flags.
1 parent 639251c commit 35caaed

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

arch/_common_switches.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22
##arch/_common_switches.sh: Switches sourced after defines.
33
##@copyright GPL-2.0+
4+
if ((AB_FLAGS_ATOMIC)); then CFLAGS_COMMON+=('-latomic'); fi
45
if ((AB_FLAGS_SSP)); then CFLAGS_COMMON+=('-fstack-protector-strong' '--param=ssp-buffer-size=4'); fi
56
if ((AB_FLAGS_SCP)); then CFLAGS_GCC_COMMON+=('-fstack-clash-protection'); fi
67
if ((AB_FLAGS_RRO)); then LDFLAGS_COMMON+=('-Wl,-z,relro'); fi

lib/default-defines.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ ABINFOCOMPRESS=1
3636
ABELFDEP=0 # Guess dependencies from ldd?
3737
ABSTRIP=1 # Should ELF be stripped off debug and unneeded symbols?
3838

39+
# Add -latomic to compiler flags.
40+
# Useful when dealing with architectures lacking 64-bit and longer atomic
41+
# operations.
42+
AB_FLAGS_ATOMIC=0
43+
3944
# Use -O3 instead?
4045
AB_FLAGS_O3=0
4146

0 commit comments

Comments
 (0)