From 1c34088ba0d3d396a44283c2f552faef3c0213d7 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Fri, 22 Mar 2024 03:55:01 -0700 Subject: [PATCH] Ignore -pie and -fpie in cosmocc Fixes #1126 --- tool/cosmocc/bin/cosmocc | 4 ++++ tool/cosmocc/bin/cosmocross | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tool/cosmocc/bin/cosmocc b/tool/cosmocc/bin/cosmocc index 7a797da21..ae71ffeba 100755 --- a/tool/cosmocc/bin/cosmocc +++ b/tool/cosmocc/bin/cosmocc @@ -180,6 +180,10 @@ for x; do # no support for building dynamic shared objects yet. reports # indicate that ignoring these flags, helps let autoconf know continue + elif [ x"$x" = x"-fpie" ] || [ x"$x" = x"-pie" ]; then + # no support for position independent executables + # https://github.com/jart/cosmopolitan/issues/1126 + continue elif [ x"$x" = x"-Werror" ] || \ [ x"$x" = x"-pedantic-errors" ]; then # this toolchain is intended for building other people's code diff --git a/tool/cosmocc/bin/cosmocross b/tool/cosmocc/bin/cosmocross index 555efff09..711c2a79f 100755 --- a/tool/cosmocc/bin/cosmocross +++ b/tool/cosmocc/bin/cosmocross @@ -142,6 +142,10 @@ for x; do continue elif [ x"$x" = x"-fPIC" ]; then continue + elif [ x"$x" = x"-fpie" ] || [ x"$x" = x"-pie" ]; then + # no support for position independent executables + # https://github.com/jart/cosmopolitan/issues/1126 + continue elif [ x"$x" = x"-r" ] || [ x"$x" = x"-pie" ] || [ x"$x" = x"-shared" ] ||