blob: 92f5b2503b79353008bf59247e10b7c13d37d2b8 [file] [log] [blame]
Brad Bishop08902b02019-08-20 09:16:51 -04001specify -fPIC after CFLAGS so it can override the CFLAGS containing -pie and -fpie this makes sure the objects that go into shared objects are compiled with -fPIC and not with -fpie. We can not use -fpie on objects which will go into .so files Fixes errors like
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002
3| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: shared/newt.o: relocation R_X86_64_PC32 against undefined symbol `SLtt_Screen_Rows@@SLANG2' can not be used when making a shared object; recompile with -fPIC
4| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: final link failed: Bad value
5| collect2: error: ld returned 1 exit status
6| make: *** [libnewt.so.0.52.18] Error 1
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Upstream-Status: Pending
Brad Bishop08902b02019-08-20 09:16:51 -040010
11---
12 Makefile.in | 6 +++---
13 1 file changed, 3 insertions(+), 3 deletions(-)
14
15diff --git a/Makefile.in b/Makefile.in
16index be5f87b..88ee0b7 100644
17--- a/Makefile.in
18+++ b/Makefile.in
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050019@@ -96,8 +96,8 @@ _snack.$(SOEXT): snack.c $(LIBNEWTSH)
20 PIFLAGS=`$$pyconfig --includes`; \
21 PLDFLAGS=`$$pyconfig --ldflags`; \
22 PLFLAGS=`$$pyconfig --libs`; \
23- echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
24- $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
25+ echo $(CC) $(CPPFLAGS) $(SHCFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
26+ $(CC) $(CPPFLAGS) $(SHCFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
27 echo $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snack.$(SOEXT) $$ver/snack.o -L. -lnewt $(LIBS); \
28 $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snack.$(SOEXT) $$ver/snack.o -L. -lnewt $(LIBS); \
29 done || :
Brad Bishop08902b02019-08-20 09:16:51 -040030@@ -133,7 +133,7 @@ $(LIBNEWTSH): $(SHAREDOBJS)
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050031
Brad Bishop08902b02019-08-20 09:16:51 -040032 $(SHAREDDIR)/%.o : %.c
33 @mkdir -p $(SHAREDDIR)
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050034- $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
35+ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(SHCFLAGS) -o $@ $<
36
37 install: $(LIBNEWT) install-sh whiptail
38 [ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir)
Brad Bishop08902b02019-08-20 09:16:51 -040039--
402.7.4
41