Skip to content

Commit

Permalink
Makefile: add PATCHELF
Browse files Browse the repository at this point in the history
  • Loading branch information
fda77 committed Feb 2, 2023
1 parent 09898bd commit d419503
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ CHECK_PREREQ_TOOL:=$(TOOLS_DIR)/prerequisites
GENERATE_IN_TOOL:=$(TOOLS_DIR)/genin
TAR:=$(TOOLS_DIR)/tar-gnu
SED:=sed
PATCHELF:=patchelf
PYTHON3=python3
MESON=meson
CMAKE=cmake
Expand Down
4 changes: 2 additions & 2 deletions make/libs/libctlmgr/libctlmgr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ $($(PKG)_DIR)/.compiled: $($(PKG)_DIR)/.configured
CPPFLAGS="$(strip $(LIBCTLMGR_CPPFLAGS))" \
LIB_VERSION="$(LIBCTLMGR_VERSION)" \
all
[ "$(FREETZ_SEPARATE_AVM_UCLIBC)" != "y" ] || patchelf --remove-rpath "$(LIBCTLMGR_BINARY)"
[ "$(FREETZ_SEPARATE_AVM_UCLIBC)" != "y" ] || patchelf --replace-needed "libc.so.0" "$(call qstrip,$(FREETZ_AVM_HAS_LIBC_FILE))" "$(LIBCTLMGR_BINARY)"
[ "$(FREETZ_SEPARATE_AVM_UCLIBC)" != "y" ] || $(PATCHELF) --remove-rpath "$(LIBCTLMGR_BINARY)"
[ "$(FREETZ_SEPARATE_AVM_UCLIBC)" != "y" ] || $(PATCHELF) --replace-needed "libc.so.0" "$(call qstrip,$(FREETZ_AVM_HAS_LIBC_FILE))" "$(LIBCTLMGR_BINARY)"
@touch "$@"

$($(PKG)_BINARY): $($(PKG)_DIR)/.compiled
Expand Down
4 changes: 2 additions & 2 deletions make/libs/libmultid/libmultid.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ $($(PKG)_DIR)/.compiled: $($(PKG)_DIR)/.configured
CPPFLAGS="$(strip $(LIBMULTID_CPPFLAGS))" \
LIB_VERSION="$(LIBMULTID_VERSION)" \
all
[ "$(FREETZ_SEPARATE_AVM_UCLIBC)" != "y" ] || patchelf --remove-rpath "$(LIBMULTID_BINARY)"
[ "$(FREETZ_SEPARATE_AVM_UCLIBC)" != "y" ] || patchelf --replace-needed "libc.so.0" "$(call qstrip,$(FREETZ_AVM_HAS_LIBC_FILE))" "$(LIBMULTID_BINARY)"
[ "$(FREETZ_SEPARATE_AVM_UCLIBC)" != "y" ] || $(PATCHELF) --remove-rpath "$(LIBMULTID_BINARY)"
[ "$(FREETZ_SEPARATE_AVM_UCLIBC)" != "y" ] || $(PATCHELF) --replace-needed "libc.so.0" "$(call qstrip,$(FREETZ_AVM_HAS_LIBC_FILE))" "$(LIBMULTID_BINARY)"
@touch "$@"

$($(PKG)_BINARY): $($(PKG)_DIR)/.compiled
Expand Down
2 changes: 1 addition & 1 deletion make/pkgs/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ endef
define INSTALL_BINARY_STRIP
$(INSTALL_FILE) \
$(TARGET_STRIP) $@; \
[ "$(FREETZ_SEPARATE_AVM_UCLIBC)" != "y" ] || patchelf --set-interpreter $(FREETZ_LIBRARY_DIR)/ld-uClibc.so.1 $@ ;
[ "$(FREETZ_SEPARATE_AVM_UCLIBC)" != "y" ] || $(PATCHELF) --set-interpreter $(FREETZ_LIBRARY_DIR)/ld-uClibc.so.1 $@ ;
endef
define INSTALL_LIBRARY__INT
chmod 755 $<; \
Expand Down
2 changes: 1 addition & 1 deletion make/pkgs/python/python.mk
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ $($(PKG)_DIR)/.installed: $($(PKG)_DIR)/.compiled
\
find usr/lib/python$(PYTHON_MAJOR_VERSION)/ -name "*.pyo" -delete; \
\
[ "$(FREETZ_SEPARATE_AVM_UCLIBC)" == "y" ] && $(FREETZ_BASE_DIR)/$(TOOLS_DIR)/patchelf --set-interpreter /usr/lib/freetz/ld-uClibc.so.1 usr/bin/python$(PYTHON_MAJOR_VERSION); \
[ "$(FREETZ_SEPARATE_AVM_UCLIBC)" == "y" ] && $(PATCHELF) --set-interpreter /usr/lib/freetz/ld-uClibc.so.1 usr/bin/python$(PYTHON_MAJOR_VERSION); \
\
$(TARGET_STRIP) \
usr/bin/python$(PYTHON_MAJOR_VERSION) \
Expand Down

0 comments on commit d419503

Please sign in to comment.