Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jhheider committed Sep 28, 2023
1 parent bfd109b commit a4e24ba
Showing 1 changed file with 51 additions and 47 deletions.
98 changes: 51 additions & 47 deletions projects/gnu.org/glibc/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ versions:

platforms: linux

runtime:
env:
# Putting ourselves in the LD_LIBRARY_PATH breaks literally everything else...
LD_LIBRARY_PATH: $(echo LD_LIBRARY_PATH | tr ':' '\n' | grep -v {{prefix}} | tr '\n' ':')

build:
dependencies:
gnu.org/make: '>=3.79'
Expand All @@ -22,21 +27,22 @@ build:
python.org: ^3
kernel.org/linux-headers: '~5.15'
working-directory: build
script: |
../configure $ARGS --with-nonshared-cflags="$CFLAGS"
make all #-j {{hw.concurrency}}
make check
make install DESTDIR={{prefix}}
script:
- ../configure $ARGS --with-nonshared-cflags="$CFLAGS"
- make all
- make check
- make install DESTDIR={{prefix}}

cd {{prefix}}/bin
for s in $SCRIPTS; do
sed -i.bak 's|{{prefix}}|"$(cd "$(dirname "$0")/.." \&\& pwd)"|' $s
rm $s.bak
done
- run: |
for s in $SCRIPTS; do
sed -i.bak 's|{{prefix}}|"$(cd "$(dirname "$0")/.." \&\& pwd)"|' $s
rm $s.bak
done
working-directory: ${{prefix}}/bin
ln -s ../lib/ld-{{ version.marketing }}.so ld.so
test:
make test
- run: ln -s ../lib/ld-{{ version.marketing }}.so ld.so
working-directory: ${{prefix}}/bin
test: make test
env:
SCRIPTS:
- catchsegv
Expand Down Expand Up @@ -68,41 +74,39 @@ build:
test:
dependencies:
gnu.org/gcc: '*'
script: |
{{prefix}}/lib/ld-{{ version.marketing }}.so --version
ld.so --version
env:
linux/x86-64:
ARCH: x86_64
linux/aarch64:
ARCH: aarch64
script:
- ${{prefix}}/lib/ld-{{ version.marketing }}.so --version
- ld.so --version

# Putting ourselves in the LD_LIBRARY_PATH breaks literally everything else...
export LD_LIBRARY_PATH=$(echo LD_LIBRARY_PATH | tr ':' '\n' | grep -v {{prefix}} | tr '\n' ':')
case "{{hw.arch}}" in
x86-64) ARCH=x86_64;;
aarch64) ARCH=aarch64;;
*)
echo "Unsupported architecture {{hw.arch}}"
exit 1
;;
esac
gcc \
-nostdinc \
-nostdlib \
-L{{prefix}}/lib \
-I{{prefix}}/include \
-I{{deps.gnu.org/gcc.prefix}}/lib/gcc/$ARCH-unknown-linux-gnu/{{deps.gnu.org/gcc.version}}/include \
-Wl,--rpath="{{prefix}}/lib" \
-Wl,--dynamic-linker={{prefix}}/lib/ld-{{ version.marketing }}.so \
-std=c11 \
-o test \
-v \
$CFLAGS \
{{prefix}}/lib/crti.o \
{{prefix}}/lib/crtn.o \
test.c \
-pthread \
-static \
-fPIC \
-pie
objdump -p test
./test
- gcc -o test1 test.c
- ./test1

- |
gcc \
-nostdinc \
-nostdlib \
-I{{deps.gnu.org/gcc.prefix}}/lib/gcc/$ARCH-unknown-linux-gnu/{{deps.gnu.org/gcc.version}}/include \
-Wl,--rpath="{{prefix}}/lib" \
-Wl,--dynamic-linker={{prefix}}/bin/ld.so \
-std=c11 \
-o test2 \
-v \
$CFLAGS \
{{prefix}}/lib/crti.o \
{{prefix}}/lib/crt1.o \
{{prefix}}/lib/crtn.o \
test.c \
-pthread \
-static \
-fPIC \
-pie
- objdump -p test2
- ./test2

provides:
- bin/catchsegv
Expand Down

0 comments on commit a4e24ba

Please sign in to comment.