]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/lynx/0001-src-chrtrans-don-t-build-host-tools-with-target-LDFL.patch
lynx: add patch to fix static link issue
[coffee/buildroot.git] / package / lynx / 0001-src-chrtrans-don-t-build-host-tools-with-target-LDFL.patch
1 From bb47abe9e7996147f6b7b325f5c9b2143abf8f13 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
3 Date: Mon, 7 May 2018 22:00:52 +0200
4 Subject: [PATCH] src/chrtrans: don't build host tools with target LDFLAGS
5
6 In a cross-compilation context, the LDFLAGS variable contains linker
7 flags used when building things for the target. However, the makeuctb
8 tool is built for the host machine, and therefore should not use the
9 same LDFLAGS as the target, which is why BUILD_LDFLAGS exist.
10
11 Using LDFLAGS when building a tool for the host can cause problems
12 when some flags in LDFLAGS are not supported by the host machine. For
13 example, if you're linking statically lynx for the target, but the
14 build machine does not support static linking:
15
16 gcc -I../.. -I../../src -I../../src/chrtrans -I../../WWW/Library/Implementation -I../../     -static  -o makeuctb makeuctb.o
17 /usr/bin/ld: cannot find -lc
18 collect2: error: ld returned 1 exit status
19
20 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
21 Upstream-status: submitted on the mailing list
22 ---
23  src/chrtrans/makefile.in | 2 +-
24  1 file changed, 1 insertion(+), 1 deletion(-)
25
26 diff --git a/src/chrtrans/makefile.in b/src/chrtrans/makefile.in
27 index aab358f..6e0ef03 100644
28 --- a/src/chrtrans/makefile.in
29 +++ b/src/chrtrans/makefile.in
30 @@ -123,7 +123,7 @@ OBJS                = makeuctb$o
31  C_SRC          = $(OBJS:$o=.c)
32  
33  $(MAKEUCTB) : $(OBJS)
34 -       $(BUILD_CC) $(CC_OPTS) $(LDFLAGS) $(BUILD_LDFLAGS) -o $@ $(OBJS) $(INTLLIB) $(BUILD_LIBS)
35 +       $(BUILD_CC) $(CC_OPTS) $(BUILD_LDFLAGS) -o $@ $(OBJS) $(INTLLIB) $(BUILD_LIBS)
36  
37  makeuctb$o : $(srcdir)/UCkd.h $(srcdir)/makeuctb.c
38  
39 -- 
40 2.14.3
41