ports/devel/tinycbor/files/patch-Makefile
Po-Chuan Hsieh a98db1c475
devel/tinycbor: Update to 0.6.1
- Backport upstream patch to fix memory leak

Changes:	https://github.com/intel/tinycbor/releases
Reference:	628dee0d65
2025-03-19 11:36:56 +08:00

20 lines
843 B
Text

--- Makefile.orig 2025-03-15 17:43:45 UTC
+++ Makefile
@@ -130,7 +130,7 @@ lib/libtinycbor.a: $(TINYCBOR_SOURCES:.c=.o)
@$(MKDIR) -p lib
$(AR) cqs $@ $^
-lib/libtinycbor.so: $(TINYCBOR_SOURCES:.c=.pic.o)
+lib/libtinycbor.so: $(TINYCBOR_SOURCES:.c=.o)
@$(MKDIR) -p lib
$(CC) -shared -Wl,-soname,libtinycbor.so.$(SOVERSION) -o lib/libtinycbor.so.$(VERSION) $(LDFLAGS) $^ $(LDLIBS)
cd lib ; ln -sf libtinycbor.so.$(VERSION) libtinycbor.so ; ln -sf libtinycbor.so.$(VERSION) libtinycbor.so.$(SOVERSION)
@@ -234,7 +234,7 @@ endif
%.o: %.c
@test -d $(@D) || $(MKDIR) $(@D)
- $(CC) $(cflags) $($(basename $(notdir $@))_CCFLAGS) -c -o $@ $<
+ $(CC) $(cflags) -fPIC $($(basename $(notdir $@))_CCFLAGS) -c -o $@ $<
%.pic.o: %.c
@test -d $(@D) || $(MKDIR) $(@D)
$(CC) $(cflags) -fPIC $($(basename $(notdir $@))_CCFLAGS) -c -o $@ $<