Skip to content

Commit

Permalink
luci-lib-nixio: fix build error with LTO
Browse files Browse the repository at this point in the history
Adding $(FPIC) parameter fixes building with CONFIG_USE_LTO enabled.

Signed-off-by: Anari Jalakas <[email protected]>
  • Loading branch information
Jalakas authored and systemcrash committed Nov 17, 2024
1 parent 5de2030 commit 44fbd00
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libs/luci-lib-nixio/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,26 @@ endif


%.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(NIXIO_CFLAGS) $(LUA_CFLAGS) $(FPIC) -c -o $@ $<
$(CC) $(CPPFLAGS) $(CFLAGS) $(NIXIO_CFLAGS) $(LUA_CFLAGS) $(FPIC) -c -o $@ $<

ifneq ($(NIXIO_TLS),)
tls-crypto.o: $(TLS_DEPENDS) tls-crypto.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(NIXIO_CFLAGS) $(LUA_CFLAGS) $(FPIC) $(TLS_CFLAGS) -c -o $@ tls-crypto.c

tls-context.o: $(TLS_DEPENDS) tls-context.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(NIXIO_CFLAGS) $(LUA_CFLAGS) $(FPIC) $(TLS_CFLAGS) -c -o $@ tls-context.c

tls-socket.o: $(TLS_DEPENDS) tls-socket.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(NIXIO_CFLAGS) $(LUA_CFLAGS) $(FPIC) $(TLS_CFLAGS) -c -o $@ tls-socket.c

axtls-compat.o: libaxtls.a axtls-compat.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(NIXIO_CFLAGS) $(LUA_CFLAGS) $(FPIC) $(TLS_CFLAGS) -c -o $@ axtls-compat.c
mkdir -p dist
cp -pR axtls-root/* dist/
endif
endif

compile: $(NIXIO_OBJ)
$(CC) $(LDFLAGS) $(SHLIB_FLAGS) -o $(NIXIO_SO) $(NIXIO_OBJ) $(NIXIO_LDFLAGS) $(NIXIO_LDFLAGS_POST)
$(CC) $(LDFLAGS) $(SHLIB_FLAGS) -o $(NIXIO_SO) $(NIXIO_OBJ) $(NIXIO_LDFLAGS) $(NIXIO_LDFLAGS_POST) $(FPIC)
mkdir -p dist/usr/lib/lua
cp $(NIXIO_SO) dist/usr/lib/lua/$(NIXIO_SO)

Expand Down

0 comments on commit 44fbd00

Please sign in to comment.