Menu

#128 LDFLAGS not respected for libgif.so

v1.0_(example)
closed
nobody
None
1
2019-03-18
2019-03-18
Arfrever
No

Currently LDFLAGS are respected when building executables (e.g. gif2rgb, gifbuild, gifecho, giffilter), but not when building libgif.so library which has custom rule in Makefile.

Makefile sets LDFLAGS = -g which does not make sense. ld tool does not use such option. ld(1) man page says:

-g  Ignored.  Provided for compatibility with other tools.

Suggested fix:

--- Makefile
+++ Makefile
@@ -10,7 +10,6 @@
 OFLAGS = -O0 -g
 #OFLAGS  = -O2 -fwhole-program
 CFLAGS  = -std=gnu99 -fPIC -Wall -Wno-format-truncation $(OFLAGS)
-LDFLAGS = -g

 SHELL = /bin/sh
 TAR = tar
@@ -66,7 +65,7 @@
 $(UTILS):: libgif.a

 libgif.so: $(OBJECTS) $(HEADERS)

-       $(CC) $(CFLAGS) -shared $(OFLAGS) -Wl,-soname -Wl,libgif.so.$(LIBMAJOR) -o libgif.so $(OBJECTS)
+       $(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,libgif.so.$(LIBMAJOR) -o libgif.so $(OBJECTS)

 libgif.a: $(OBJECTS) $(HEADERS)
        $(AR) rcs libgif.a $(OBJECTS)

xxx

Discussion

  • Eric S. Raymond

    Eric S. Raymond - 2019-03-18

    Patch accepted and pushed,

     
  • Eric S. Raymond

    Eric S. Raymond - 2019-03-18
    • status: open --> closed
     

Log in to post a comment.