Group :: Ferramentas de Arquivo
RPM: eresi
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: 0001-fix-underlinking-when-linking-with-Wl-as-needed.patch
Download
Download
From 9b896dba4fa97d5a0c0f27c792f4bec80eb4fd06 Mon Sep 17 00:00:00 2001
From: Vitaly Lipatov <lav@etersoft.ru>
Date: Fri, 6 Jul 2018 21:53:48 +0300
Subject: [PATCH] fix underlinking when linking with -Wl,--as-needed
To: wine-patches <wine-patches@winehq.org>
---
configure | 8 ++++----
libasm/Makefile | 11 +++++++----
libaspect/Makefile | 10 ++++++++--
libe2dbg/Makefile | 4 ++--
libedfmt/Makefile | 10 ++++------
libelfsh/Makefile | 4 ++--
libetrace/Makefile | 17 +++++++++++------
7 files changed, 38 insertions(+), 26 deletions(-)
diff --git a/configure b/configure
index 0988e59..53a05de 100755
--- a/configure
+++ b/configure
@@ -662,14 +662,14 @@ echo " @echo 'Building libelfsh...' " >> Makefile
echo " @cd libelfsh && \$(MAKE) \$(BUILD_TARGET)" >> Makefile
echo " @echo 'Libelfsh has been built successfully.' " >> Makefile
-echo " @echo 'Building libetrace...' " >> Makefile
-echo " @cd libetrace && \$(MAKE) \$(BUILD_TARGET)" >> Makefile
-echo " @echo 'Libetrace has been built successfully.' " >> Makefile
-
echo " @echo 'Building libedfmt...' " >> Makefile
echo " @cd libedfmt && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'Libedfmt has been built successfully.' " >> Makefile
+echo " @echo 'Building libetrace...' " >> Makefile
+echo " @cd libetrace && \$(MAKE) \$(BUILD_TARGET)" >> Makefile
+echo " @echo 'Libetrace has been built successfully.' " >> Makefile
+
if [ "$ERESI_NET" = "1" ]; then
echo " @echo 'Building libdump...' " >> Makefile
diff --git a/libasm/Makefile b/libasm/Makefile
index 762e028..52638a4 100644
--- a/libasm/Makefile
+++ b/libasm/Makefile
@@ -141,6 +141,9 @@ NAME_sparc = test_sparc
CFLAGS32 = $(CFLAGS) -Iinclude -Isrc/include -Wall -g3 -fPIC -I../libaspect/include -DERESI32
CFLAGS64 = $(CFLAGS) -Iinclude -Isrc/include -Wall -g3 -fPIC -I../libaspect/include -DERESI64
+LDFLAGS32 = -L../libaspect/ -laspect32
+LDFLAGS64 = -L../libaspect/ -laspect64
+
RM = rm -f
ETAGS = etags
CC ?= gcc -E
@@ -173,9 +176,9 @@ libasm32.so: $(PACKED_ARCH) $(OBJS32_libasm)
$(LD) -r $(OBJS32_libasm) -o ${NAME32_libasm_o}
#echo "[CC -shared] libasm32.so"
ifeq ($(IRIX),1)
- $(LD) -L../libaspect/ -laspect32 ${OBJS32_libasm} -o libasm32.so -shared
+ $(LD) ${OBJS32_libasm} ${LDFLAGS32} -o libasm32.so -shared
else
- $(CC) -L../libaspect/ -laspect32 ${OBJS32_libasm} -o libasm32.so -shared
+ $(CC) ${OBJS32_libasm} ${LDFLAGS32} -o libasm32.so -shared
endif
libasm64.so: $(PACKED_ARCH) $(OBJS64_libasm)
@@ -186,9 +189,9 @@ libasm64.so: $(PACKED_ARCH) $(OBJS64_libasm)
$(LD) -r $(OBJS64_libasm) -o ${NAME64_libasm_o}
#echo "[CC -shared] libasm64.so"
ifeq ($(IRIX),1)
- $(LD) -L../libaspect/ -laspect64 ${OBJS64_libasm} -o libasm64.so -shared
+ $(LD) ${OBJS64_libasm} ${LDFLAGS32} -o libasm64.so -shared
else
- $(CC) -L../libaspect/ -laspect64 ${OBJS64_libasm} -o libasm64.so -shared
+ $(CC) ${OBJS64_libasm} ${LDFLAGS64} -o libasm64.so -shared
endif
clean:
diff --git a/libaspect/Makefile b/libaspect/Makefile
index 4ee913c..02d2183 100644
--- a/libaspect/Makefile
+++ b/libaspect/Makefile
@@ -10,8 +10,14 @@ LD = ld
RM = rm -f
AR = ar rc
RANLIB = ranlib
+
CFLAGS32 += -Iinclude -fPIC -g3 -O2 -DERESI32 $(EXTRACFLAGS)
CFLAGS64 += -Iinclude -fPIC -g3 -O2 -DERESI64 $(EXTRACFLAGS)
+
+LDFLAGS32 = -L../liballocproxy/ -lallocproxy
+
+LDFLAGS64 = -L../liballocproxy/ -lallocproxy
+
SRC = vectors.c libhash.c libbtree.c types.c init.c \
config.c profiler.c liblist.c containers.c
@@ -24,7 +30,7 @@ NAME64 = libaspect64
all : all32 all64
libaspect32.so : $(OBJ32)
- @$(CC) -L../liballocproxy/ -lallocproxy $(DLOPT) -shared $(OBJ32) -o $(NAME32).so
+ @$(CC) $(DLOPT) -shared $(OBJ32) $(LDFLAGS32) -o $(NAME32).so
@$(AR) $(NAME32).a $(OBJ32)
@$(RANLIB) $(NAME32).a
$(LD) -r $(OBJ32) -o $(NAME32).o
@@ -32,7 +38,7 @@ libaspect32.so : $(OBJ32)
all32: libaspect32.so
libaspect64.so : $(OBJ64)
- @$(LD) -L../liballocproxy/ -lallocproxy $(DLOPT) -shared $(OBJ64) -o $(NAME64).so
+ @$(LD) $(DLOPT) -shared $(OBJ64) $(LDFLAGS64) -o $(NAME64).so
@$(AR) $(NAME64).a $(OBJ64)
@$(RANLIB) $(NAME64).a
$(LD) -r $(OBJ64) -o $(NAME64).o
diff --git a/libe2dbg/Makefile b/libe2dbg/Makefile
index fecace2..c7156ab 100644
--- a/libe2dbg/Makefile
+++ b/libe2dbg/Makefile
@@ -18,8 +18,8 @@ KDBGNAME64O = ke2dbg-rel64.o
AR = ar rc
STRIP = strip
-LDFLAGS32 += $(DLOPT) $(DYNOPT) $(EXTRAOPT)
-LDFLAGS64 += $(DLOPT) $(DYNOPT) $(EXTRAOPT)
+LDFLAGS32 += $(LPTHREAD) -lcrypto $(DLOPT) $(DYNOPT) $(EXTRAOPT)
+LDFLAGS64 += $(LPTHREAD) -lcrypto $(DLOPT) $(DYNOPT) $(EXTRAOPT)
EXTRAOBJ32 = ../libasm/libasm32.o ../libmjollnir/libmjollnir32.o \
../libelfsh/libelfsh32.o ../libedfmt/libedfmt32.o \
diff --git a/libedfmt/Makefile b/libedfmt/Makefile
index c7bc1b2..7f9ecac 100644
--- a/libedfmt/Makefile
+++ b/libedfmt/Makefile
@@ -25,22 +25,20 @@ CFLAGS64 += -Wall -fPIC -g3 -Iinclude -I ../libaspect/include/ \
-I../libelfsh/include/ -DERESI64 $(EXTRACFLAGS)
LDFLAGS32 += -L../libaspect/ -laspect32 -L../libelfsh/ -lelfsh32
-# -L../liballocproxy -lallocproxy
-LDFLAGS64 += -L../libaspect/ -laspect64 -L../libelfsh/ -lelfsh64 \
- -L../liballocproxy/ -lallocproxy
+LDFLAGS64 += -L../libaspect/ -laspect64 -L../libelfsh/ -lelfsh64
all : all32 all64
-libedfmt32.so : $(OBJ32)
- @$(CC) $(LDFLAGS32) -shared $(OBJ32) -o $(NAME32).so
+libedfmt32.so : $(OBJ32)
+ @$(CC) -shared $(OBJ32) $(LDFLAGS32) -o $(NAME32).so
@$(AR) $(NAME32).a $(OBJ32)
@$(RANLIB) $(NAME32).a
@$(LD) -r $(OBJ32) -o $(NAME32).o
all32: libedfmt32.so
libedfmt64.so : $(OBJ64)
- @$(CC) $(LDFLAGS64) -shared $(OBJ64) -o $(NAME64).so
+ @$(CC) -shared $(OBJ64) $(LDFLAGS64) -o $(NAME64).so
@$(AR) $(NAME64).a $(OBJ64)
@$(RANLIB) $(NAME64).a
@$(LD) -r $(OBJ64) -o $(NAME64).o
diff --git a/libelfsh/Makefile b/libelfsh/Makefile
index 67b96fb..7f3b82c 100644
--- a/libelfsh/Makefile
+++ b/libelfsh/Makefile
@@ -47,7 +47,7 @@ all : all32 all64
libelfsh32.so : $(OBJ32)
- @$(CC) $(LDFLAGS32) -shared $(OBJ32) -o $(NAME32).so
+ @$(CC) -shared $(OBJ32) $(LDFLAGS32) -o $(NAME32).so
@$(AR) $(NAME32).a $(OBJ32)
@$(RANLIB) $(NAME32).a
@$(LD) -r $(OBJ32) -o $(NAME32).o
@@ -56,7 +56,7 @@ all32: libelfsh32.so
libelfsh64.so : $(OBJ64)
- @$(CC) $(LDFLAGS64) -shared $(OBJ64) -o $(NAME64).so
+ @$(CC) -shared $(OBJ64) $(LDFLAGS64) -o $(NAME64).so
@$(AR) $(NAME64).a $(OBJ64)
@$(RANLIB) $(NAME64).a
@$(LD) -r $(OBJ64) -o $(NAME64).o
diff --git a/libetrace/Makefile b/libetrace/Makefile
index 603c181..4963b55 100644
--- a/libetrace/Makefile
+++ b/libetrace/Makefile
@@ -19,6 +19,15 @@ CFLAGS64 += -Iinclude -Wall -fPIC -g3 -O2 $(EXTRACFLAGS) \
-I../libasm/include/ -I../libaspect/include/ \
-I../libelfsh/include/ -DERESI64 $(BUILDOP) \
-I../libedfmt/include/
+
+LDFLAGS32 = -L../liballocproxy/ -lallocproxy \
+ -L../libaspect/ -laspect32 -L../libelfsh/ -lelfsh32 \
+ -L../libedfmt/ -ledfmt32 -L../libasm -lasm32
+
+LDFLAGS64 = -L../liballocproxy/ -lallocproxy \
+ -L../libaspect/ -laspect64 -L../libelfsh/ -lelfsh64 \
+ -L../libedfmt/ -ledfmt64 -L../libasm -lasm64
+
SRC = errfunc.c save.c search_addr.c delete.c \
check.c check_untracable.c func_add.c func_remove.c \
func_exclude.c func_enable.c func_disable.c \
@@ -34,17 +43,13 @@ LDFLAGS =
all : all32 all64
all32 : $(OBJ32)
- @$(CC) -L../liballocproxy/ \
- -lallocproxy -L../libaspect/ -laspect32 -DERESI32 \
- -L../libelfsh/ -lelfsh32 -shared $(OBJ32) -o $(NAME32).so
+ @$(CC) -shared $(OBJ32) $(LDFLAGS32) -o $(NAME32).so
@$(AR) $(NAME32).a $(OBJ32)
@$(RANLIB) $(NAME32).a
@$(LD) -r $(OBJ32) -o $(NAME32).o
all64 : $(OBJ64)
- @$(CC) -L../liballocproxy/ \
- -lallocproxy -L../libaspect/ -laspect64 -DERESI64 \
- -L../libelfsh/ -lelfsh64 -shared $(OBJ64) -o $(NAME64).so
+ @$(CC) -shared $(OBJ64) $(LDFLAGS64) -o $(NAME64).so
@$(AR) $(NAME64).a $(OBJ64)
@$(RANLIB) $(NAME64).a
@$(LD) -r $(OBJ64) -o $(NAME64).o
--
2.10.5