summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/newt/files/cross_ar.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-extended/newt/files/cross_ar.patch')
-rw-r--r--meta-oe/recipes-extended/newt/files/cross_ar.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/newt/files/cross_ar.patch b/meta-oe/recipes-extended/newt/files/cross_ar.patch
new file mode 100644
index 0000000000..eb8c4134b2
--- /dev/null
+++ b/meta-oe/recipes-extended/newt/files/cross_ar.patch
@@ -0,0 +1,59 @@
1From 0f33421000006f5991d1cddcb9dbc68b64141e44 Mon Sep 17 00:00:00 2001
2From: Jason Wessel <jason.wessel@windriver.com>
3Date: Wed, 19 Jun 2024 11:22:48 +0200
4Subject: [PATCH] Fix cross link using autoconf detected AR
5
6If building on 32bit host and creating 64bit libraries, the target
7package builds should not invoke the 32bit hosts's ar. Specifically
8you will get an error message like:
9
10x86_64-linux-gcc -m64 --sysroot=/opt/qemux86-64/tmp/sysroots/qemux86-64 -g -o test test.o libnewt.a -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lslang
11libnewt.a: could not read symbols: Archive has no index; run ranlib to add one
12collect2: error: ld returned 1 exit status
13
14Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
15
16Upstream-Status: Pending
17
18Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
19---
20 Makefile.in | 3 ++-
21 configure.ac | 4 ++++
22 2 files changed, 6 insertions(+), 1 deletion(-)
23
24diff --git a/Makefile.in b/Makefile.in
25index f8fe290..8a44a56 100644
26--- a/Makefile.in
27+++ b/Makefile.in
28@@ -7,6 +7,7 @@ CFLAGS = @CFLAGS@
29 LDFLAGS = @LDFLAGS@
30 CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@
31 GNU_LD = @GNU_LD@
32+AR = @AR@
33
34 VERSION = @VERSION@
35 TAG = r$(subst .,-,$(VERSION))
36@@ -109,7 +110,7 @@ whiptcl.$(SOEXT): $(WHIPTCLOBJS) $(LIBNEWTSH)
37 $(CC) -shared $(SHCFLAGS) $(LDFLAGS) -o whiptcl.$(SOEXT) $(WHIPTCLOBJS) -L. -lnewt $(LIBTCL) -lpopt $(LIBS)
38
39 $(LIBNEWT): $(LIBOBJS)
40- ar rv $@ $^
41+ $(AR) rv $@ $^
42
43 newt.o $(SHAREDDIR)/newt.o: newt.c Makefile
44
45diff --git a/configure.ac b/configure.ac
46index 434121e..2cfffd6 100644
47--- a/configure.ac
48+++ b/configure.ac
49@@ -15,6 +15,10 @@ AC_PROG_CC
50 AC_PROG_LN_S
51 AC_PROG_GREP
52 AC_SYS_LARGEFILE
53+AN_MAKEVAR([AR], [AC_PROG_AR])
54+AN_PROGRAM([ar], [AC_PROG_AR])
55+AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
56+AC_PROG_AR
57
58 AC_CHECK_SIZEOF([long])
59 AC_CHECK_SIZEOF([long long])