bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/1] ncurses: patch to correct linker flag sequence


From: Jay Shah
Subject: [PATCH 1/1] ncurses: patch to correct linker flag sequence
Date: Fri, 24 Nov 2017 05:41:44 -0600

From: Yogesh Prasad <address@hidden>

Description
 This patch will correct the sequence of -pie and -shared options.
 When used together, -pie should be provided to the linker before
 -shared. If -pie is provided after -shared, the linker throws an
 error shown below as example.

The patch fixes Makefile.am for below libs within setools:
 - libncurses.so.6.0
-------------------------------------------------------------------------
/host/powerpc-buildroot-linux-gnu/sysroot/usr/lib/Scrt1.o:(.data+0x4):
 undefined reference to `main'
/host/lib/gcc/powerpc-buildroot-linux-gnu/6.4.0/../../../..
/powerpc-buildroot-linux-gnu/bin/ld: BFD (GNU Binutils) 2.28.1
 assertion fail elf32-ppc.c:8923
collect2: error: ld returned 1 exit status
make[3]: *** [../lib/libncurses.so.6.0] Error 1
make[2]: *** [all] Error 2
make[1]: *** [/build/ncurses-6.0/.stamp_built] Error 2
make: *** [_all] Error 2
-------------------------------------------------------------------------

Signed-off-by: Yogesh Prasad <address@hidden>
Signed-off-by: Matt Weber <address@hidden>
---
 configure  | 2 +-
 mk-1st.awk | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 29c61bd..aa42c0a 100755
--- a/configure
+++ b/configure
@@ -6204,7 +6204,7 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
                cf_cv_shared_soname='`basename address@hidden'
        fi
 
-               MK_SHARED_LIB='${CC} ${CFLAGS} -shared 
-Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
+               MK_SHARED_LIB='${CC} ${CFLAGS} 
-Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
                ;;
        (mingw*)
                cf_cv_shlib_version=mingw
diff --git a/mk-1st.awk b/mk-1st.awk
index 1b88127..054e9d5 100644
--- a/mk-1st.awk
+++ b/mk-1st.awk
@@ -170,7 +170,7 @@ function removelinks(directory) {
                }
        }
 function make_shlib(objs, shlib_list) {
-               printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(%s) $(LDFLAGS)\n", 
objs, shlib_list
+               printf "\t$(MK_SHARED_LIB) $(LDFLAGS) -shared $(%s_OBJS) 
$(%s)\n", objs, shlib_list
        }
 function sharedlinks(directory) {
                if ( ShlibVer != "auto" && ShlibVer != "cygdll" && ShlibVer != 
"msysdll" && ShlibVer != "mingw" ) {
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]