Skip to content

Commit

Permalink
switch-arch: disable generation of position independent code (-fno-pic)
Browse files Browse the repository at this point in the history
This is required to ensure that the output binaries are generated in a
form that will execute correctly as firmware at a fixed location.

Signed-off-by: Mark Cave-Ayland <[email protected]>
  • Loading branch information
mcayland committed Apr 17, 2024
1 parent fbaf75f commit d3a643a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions config/scripts/switch-arch
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ for ARCH in $arch_list; do
select_prefix powerpc powerpc64
if [ "$unix" = "no" ]; then
# 604 cpu includes support for PReP as well as Mac
CFLAGS="-m32 -mcpu=604 -msoft-float -fno-builtin-bcopy -fno-builtin-log2 -fno-stack-protector"
CFLAGS="-m32 -mcpu=604 -msoft-float -fno-builtin-bcopy -fno-builtin-log2 -fno-stack-protector -fno-pic"
AS_FLAGS="-m32"
else
CFLAGS="-fno-builtin -fno-stack-protector"
Expand All @@ -278,25 +278,25 @@ for ARCH in $arch_list; do
select_prefix powerpc64

# 970 cpu is used in all 64-bit Macs but disable altivec
CFLAGS="-mcpu=970 -mno-altivec -Wa,-a64 -m64 -msoft-float -fno-builtin -fno-stack-protector"
CFLAGS="-mcpu=970 -mno-altivec -Wa,-a64 -m64 -msoft-float -fno-builtin -fno-stack-protector -fno-pic"
AS_FLAGS="-Wa,-a64"
;;

sparc32)
select_prefix sparc sparc64
CFLAGS="-Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc -fno-builtin -fno-stack-protector"
CFLAGS="-Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc -fno-builtin -fno-stack-protector -fno-pic"
AS_FLAGS="-Wa,-xarch=v8 -Wa,-32"
;;

sparc64)
select_prefix sparc64
CFLAGS="-Wa,-xarch=v9b -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany -fno-builtin -fno-stack-protector"
CFLAGS="-Wa,-xarch=v9b -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany -fno-builtin -fno-stack-protector -fno-pic"
AS_FLAGS="-Wa,-xarch=v9b -Wa,-64"
;;

x86)
select_prefix i486 x86_64
CFLAGS="-fno-builtin -m32 -fno-stack-protector"
CFLAGS="-fno-builtin -m32 -fno-stack-protector -fno-pic"
AS_FLAGS="-Wa,-32"
;;
esac
Expand Down

0 comments on commit d3a643a

Please sign in to comment.