In a cross-compilation context, the LDFLAGS variable contains linker
flags used when building things for the target. However, the makeuctb
tool is built for the host machine, and therefore should not use the
same LDFLAGS as the target, which is why BUILD_LDFLAGS exist.

Using LDFLAGS when building a tool for the host can cause problems
when some flags in LDFLAGS are not supported by the host machine. For
example, if you're linking statically lynx for the target, but the
build machine does not support static linking:

gcc -I../.. -I../../src -I../../src/chrtrans -I../../WWW/Library/Implementation 
-I../../     -static  -o makeuctb makeuctb.o
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status

Signed-off-by: Thomas Petazzoni <thomas.petazz...@bootlin.com>
---
 src/chrtrans/makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/chrtrans/makefile.in b/src/chrtrans/makefile.in
index aab358f..6e0ef03 100644
--- a/src/chrtrans/makefile.in
+++ b/src/chrtrans/makefile.in
@@ -123,7 +123,7 @@ OBJS                = makeuctb$o
 C_SRC          = $(OBJS:$o=.c)
 
 $(MAKEUCTB) : $(OBJS)
-       $(BUILD_CC) $(CC_OPTS) $(LDFLAGS) $(BUILD_LDFLAGS) -o $@ $(OBJS) 
$(INTLLIB) $(BUILD_LIBS)
+       $(BUILD_CC) $(CC_OPTS) $(BUILD_LDFLAGS) -o $@ $(OBJS) $(INTLLIB) 
$(BUILD_LIBS)
 
 makeuctb$o : $(srcdir)/UCkd.h $(srcdir)/makeuctb.c
 
-- 
2.14.3


_______________________________________________
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev

Reply via email to