From 37e18a40ac8baed1a56b985859cbfaf2075a7298 Mon Sep 17 00:00:00 2001 From: Louis Bettens Date: Fri, 19 Aug 2022 11:39:18 +0200 Subject: [PATCH] cosmoc: update flags --- pkgs/development/tools/cosmoc/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/cosmoc/default.nix b/pkgs/development/tools/cosmoc/default.nix index f1e80d91df55..e64cf02e9f7e 100644 --- a/pkgs/development/tools/cosmoc/default.nix +++ b/pkgs/development/tools/cosmoc/default.nix @@ -8,18 +8,19 @@ stdenv.mkDerivation { dontUnpack = true; dontBuild = true; + # compiler arguments based on upstream README.md installPhase = '' runHook preInstall mkdir -p $out/bin cat <$out/bin/cosmoc #!${stdenv.shell} exec ${stdenv.cc}/bin/${stdenv.cc.targetPrefix}gcc \ - -O -static -nostdlib -nostdinc -fno-pie -no-pie -mno-red-zone \ + -Os -static -nostdlib -nostdinc -fno-pie -no-pie -mno-red-zone \ + -fno-omit-frame-pointer -pg -mnop-mcount -mno-tls-direct-seg-refs \ "\$@" \ - -Wl,--gc-sections -Wl,-z,max-page-size=0x1000 \ - -fuse-ld=bfd -Wl,-T,${cosmopolitan}/lib/ape.lds \ + -fuse-ld=bfd -Wl,-T,${cosmopolitan}/lib/ape.lds -Wl,--gc-sections \ -include ${cosmopolitan}/include/cosmopolitan.h \ - ${cosmopolitan}/lib/{crt.o,ape.o,cosmopolitan.a} + ${cosmopolitan}/lib/{crt.o,ape-no-modify-self.o,cosmopolitan.a} EOF chmod +x $out/bin/cosmoc runHook postInstall