Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 4cefca4

Browse files
bwardenbryteise
authored andcommitted
Only capture unoptimized libraries
We don't know what platform this will run on, so don't even bother capturing the haswell/glibc-hwcaps library versions -- just find the unoptimized originals.
1 parent 94881ce commit 4cefca4

File tree

1 file changed

+5
-38
lines changed

1 file changed

+5
-38
lines changed

Makefile

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,19 @@ all: $(TARGET)
1111
clr-init.cpio:
1212
set -e;
1313
mkdir -p initramfs/{sys,dev,proc,tmp,var,sysroot,usr/bin,usr/lib/systemd/system-generators,usr/lib64,usr/lib64/multipath,run,root,usr/lib/udev/rules.d,usr/lib/udev/hwdb.d}
14-
if [ -d /usr/lib64/haswell/ ]; then \
15-
mkdir -p initramfs/usr/lib64/haswell;\
16-
fi
17-
if [ -d /usr/lib64/haswell/avx512_1 ]; then \
18-
mkdir -p initramfs/usr/lib64/haswell/avx512_1;\
19-
fi
20-
if [ -d /usr/lib64/glibc-hwcaps/ ]; then \
21-
mkdir -p initramfs/usr/lib64/glibc-hwcaps;\
22-
fi
23-
if [ -d /usr/lib64/glibc-hwcaps/x86-64-v3 ]; then \
24-
mkdir -p initramfs/usr/lib64/glibc-hwcaps/x86-64-v3;\
25-
fi
26-
if [ -d /usr/lib64/glibc-hwcaps/x86-64-v4 ]; then \
27-
mkdir -p initramfs/usr/lib64/glibc-hwcaps/x86-64-v4;\
28-
fi
2914
for file in $(BINFILES); do \
3015
mkdir -p initramfs/$$(dirname "$${file}"); \
3116
cp -fL $$file initramfs/$$file || exit 1;\
3217
if file $$file | grep -q ELF; then \
3318
for lddfile in $$(ldd $$file | awk '{print $$3}' | grep "^/"); do \
34-
file_path=$$(dirname $$lddfile); \
35-
cp -Lu $$lddfile initramfs/$$file_path/; \
19+
base_lib=$$(sed 's/glibc-hwcaps\/x86-64-v[34]\///' <<< $${lddfile}); \
20+
file_path=$$(dirname $${base_lib}); \
21+
mkdir -p initramfs/$${file_path}; \
22+
echo cp -Lu $$base_lib initramfs/$$file_path/; \
23+
cp -Lu $$base_lib initramfs/$$file_path/; \
3624
done \
3725
fi \
3826
done
39-
if [ -d /usr/lib64/haswell/ ]; then \
40-
for lib in $$(ls initramfs/usr/lib64/haswell/); do \
41-
[ $$lib == "avx512_1" ] && continue; \
42-
cp -L /usr/lib64/$$lib initramfs/usr/lib64/ ; \
43-
done \
44-
fi
45-
if [ -d /usr/lib64/haswell/avx512_1 ]; then \
46-
for lib in $$(ls initramfs/usr/lib64/haswell/avx512_1/); do \
47-
cp -L /usr/lib64/$$lib initramfs/usr/lib64/ ; \
48-
done \
49-
fi
50-
if [ -d /usr/lib64/glibc-hwcaps/x86-64-v3 ]; then \
51-
for lib in $$(ls initramfs/usr/lib64/glibc-hwcaps/x86-64-v3/); do \
52-
cp -L /usr/lib64/$$lib initramfs/usr/lib64/ ; \
53-
done \
54-
fi
55-
if [ -d /usr/lib64/glibc-hwcaps/x86-64-v4 ]; then \
56-
for lib in $$(ls initramfs/usr/lib64/glibc-hwcaps/x86-64-v4/); do \
57-
cp -L /usr/lib64/$$lib initramfs/usr/lib64/ ; \
58-
done \
59-
fi
6027
( cd initramfs && \
6128
find . -print0 | cpio -o --null --format=newc ) > $@
6229

0 commit comments

Comments
 (0)