toolchain: fix gcc custom linker path

Loongarch64 requires gcc/config/loongarch/gnu-user.h
change for custom linker path when compiling gcc
tool chain

fix: https://github.com/vincentmli/BPFire/issues/67

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
Vincent Li
2024-12-17 19:24:52 -08:00
parent a0eed98b22
commit 30339c14a1
2 changed files with 5 additions and 2 deletions

View File

@@ -231,6 +231,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
ifeq "$(TOOLCHAIN)" "1"
#loongarch64
ifeq "$(BUILD_ARCH)" "loongarch64"
sed -i.orig '/ABI_GRLEN_SPEC/s@"/lib" ABI_GRLEN_SPEC@"$(TOOLS_DIR)/lib" ABI_GRLEN_SPEC@g' $(DIR_APP)/gcc/config/loongarch/gnu-user.h
endif
for file in $$(find $(DIR_APP)/gcc/config -name linux64.h -o -name linux.h \
-o -name sysv4.h -o -name linux-eabi.h -o -name linux-elf.h -o -name aarch64-linux.h); do \
echo "Processing $${file}..."; \

View File

@@ -157,8 +157,7 @@ ifeq "$(TOOLCHAIN)" "1"
cd $(DIR_APP) && $(CROSSTARGET)-gcc dummy.c -o dummy
# Must be using a runtime linker from $(TOOLS_DIR)
#cd $(DIR_APP) && readelf -l dummy | grep "Requesting program interpreter: $(TOOLS_DIR)"
cd $(DIR_APP) && readelf -l dummy | grep "Requesting program interpreter: /lib64/ld-linux-loongarch-lp64d.so.1"
cd $(DIR_APP) && readelf -l dummy | grep "Requesting program interpreter: $(TOOLS_DIR)"
cd $(DIR_APP) && rm -vf dummy dummy.c
endif