minimal-bootstrap.tinycc-*: static link by default

This commit is contained in:
Emily Trau 2023-05-24 11:58:37 +10:00
parent 2ae0a16d59
commit ea7533164c
10 changed files with 18 additions and 10 deletions

View File

@ -61,7 +61,7 @@ bash.runCommand "${pname}-${version}" {
# Build
make \
CC="tcc -static -B ${tinycc.libs}/lib -I ." \
CC="tcc -B ${tinycc.libs}/lib -I ." \
AR="tcc -ar" \
bzip2 bzip2recover

View File

@ -59,7 +59,7 @@ bash.runCommand "${pname}-${version}" {
${lib.concatMapStringsSep "\n" (f: "patch -Np0 -i ${f}") patches}
# Configure
export CC="tcc -static -B ${tinycc.libs}/lib"
export CC="tcc -B ${tinycc.libs}/lib"
export ac_cv_func_getpgrp_void=yes
export ac_cv_func_tzset=yes
bash ./configure \

View File

@ -53,7 +53,7 @@ bash.runCommand "${pname}-${version}" {
cp ${makefile} Makefile
# Build
make CC="tcc -static -B ${tinycc.libs}/lib"
make CC="tcc -B ${tinycc.libs}/lib"
# Install
make install PREFIX=$out

View File

@ -45,7 +45,7 @@ let
./configure \
--build i686-pc-linux-gnu \
--host i686-pc-linux-gnu \
CC="${tinycc.compiler}/bin/tcc -B ${tinycc.libs}/lib -static" \
CC="${tinycc.compiler}/bin/tcc -B ${tinycc.libs}/lib" \
ac_cv_func_dup=no
- `ac_cv_func_dup` disabled as mes-libc doesn't implement tmpfile()
@ -178,7 +178,7 @@ kaem.runCommand "${pname}-${version}" {
${lib.concatMapStringsSep "\n" (f: "CC -c ${f}") sources}
# Link
CC -static -o make ${lib.concatStringsSep " " objects}
CC -o make ${lib.concatStringsSep " " objects}
# Check
./make --version

View File

@ -95,7 +95,7 @@ kaem.runCommand "${pname}-${version}" {
${lib.concatMapStringsSep "\n" (f: "CC -c ${f}") sources}
# Link
CC -static -o patch ${lib.concatStringsSep " " objects}
CC -o patch ${lib.concatStringsSep " " objects}
# Check
./patch --version

View File

@ -50,7 +50,7 @@ bash.runCommand "${pname}-${version}" {
cd tar-${version}
# Configure
export CC="tcc -static -B ${tinycc.libs}/lib"
export CC="tcc -B ${tinycc.libs}/lib"
bash ./configure \
--build=${buildPlatform.config} \
--host=${hostPlatform.config} \

View File

@ -46,7 +46,7 @@ bash.runCommand "${pname}-${version}" {
cd gzip-${version}
# Configure
export CC="tcc -static -B ${tinycc.libs}/lib -Dstrlwr=unused"
export CC="tcc -B ${tinycc.libs}/lib -Dstrlwr=unused"
bash ./configure --prefix=$out
# Build

View File

@ -29,6 +29,11 @@ let
mkdir -p ''${out}
cd ''${out}
untar --file ''${NIX_BUILD_TOP}/tinycc.tar
# Patch
cd tinycc-${rev}
# Static link by default
replace --file libtcc.c --output libtcc.c --match-on "s->ms_extensions = 1;" --replace-with "s->ms_extensions = 1; s->static_link = 1;"
'') + "/tinycc-${rev}";
meta = with lib; {

View File

@ -74,7 +74,6 @@ rec {
-B ${prev.libs}/lib \
-g \
-v \
-static \
-o ''${out}/bin/tcc \
-D BOOTSTRAP=1 \
${options} \

View File

@ -25,6 +25,11 @@ let
mkdir -p ''${out}
cd ''${out}
untar --file ''${NIX_BUILD_TOP}/tinycc.tar
# Patch
cd tinycc-${builtins.substring 0 7 rev}
# Static link by default
replace --file libtcc.c --output libtcc.c --match-on "s->ms_extensions = 1;" --replace-with "s->ms_extensions = 1; s->static_link = 1;"
'') + "/tinycc-${builtins.substring 0 7 rev}";
meta = with lib; {
@ -39,7 +44,6 @@ let
mkdir ''${out}
${tinycc-bootstrappable.compiler}/bin/tcc \
-B ${tinycc-bootstrappable.libs}/lib \
-static \
-DC2STR \
-o c2str \
${src}/conftest.c