Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 1 | specify -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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 2 | |
| 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 | |
| 8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 9 | Upstream-Status: Pending |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 10 | |
| 11 | --- |
| 12 | Makefile.in | 6 +++--- |
| 13 | 1 file changed, 3 insertions(+), 3 deletions(-) |
| 14 | |
| 15 | diff --git a/Makefile.in b/Makefile.in |
| 16 | index be5f87b..88ee0b7 100644 |
| 17 | --- a/Makefile.in |
| 18 | +++ b/Makefile.in |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 19 | @@ -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 Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 30 | @@ -133,7 +133,7 @@ $(LIBNEWTSH): $(SHAREDOBJS) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 31 | |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 32 | $(SHAREDDIR)/%.o : %.c |
| 33 | @mkdir -p $(SHAREDDIR) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 34 | - $(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 Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 39 | -- |
| 40 | 2.7.4 |
| 41 | |