Skip to content

Commit

Permalink
Merge branch 'print-libgcc-file-name' of https://github.com/vimproved…
Browse files Browse the repository at this point in the history
…/liburing

* 'print-libgcc-file-name' of https://github.com/vimproved/liburing:
  Link against libgcc based on output of -print-libgcc-file-name
  • Loading branch information
axboe committed Dec 18, 2023
2 parents b2c8b97 + 09b8ded commit bbd2749
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ print_and_output_mak "relativelibdir" "$relativelibdir"
print_and_output_mak "mandir" "$mandir"
print_and_output_mak "datadir" "$datadir"

####################################################
# Check for correct compiler runtime library to link with
libgcc_link_flag="-lgcc"
if $cc -print-libgcc-file-name >/dev/null 2>&1; then
libgcc_link_flag="$($cc $CFLAGS $LDFLAGS -print-libgcc-file-name)"
fi
print_and_output_mak "libgcc_link_flag" "$libgcc_link_flag"
####################################################

##########################################
# check for compiler -Wstringop-overflow
stringop_overflow="no"
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ifeq ($(CONFIG_NOLIBC),y)
liburing_srcs += nolibc.c
override CFLAGS += -nostdlib -nodefaultlibs -ffreestanding -fno-builtin -fno-stack-protector
override CPPFLAGS += -nostdlib -nodefaultlibs -ffreestanding -fno-builtin -fno-stack-protector
override LINK_FLAGS += -nostdlib -nodefaultlibs -lgcc
override LINK_FLAGS += -nostdlib -nodefaultlibs $(libgcc_link_flag)
endif

override CPPFLAGS += -MT "$@" -MMD -MP -MF "$@.d"
Expand Down

0 comments on commit bbd2749

Please sign in to comment.