Skip to content

fails to link musl libc (wild: error: unrecognized option(s): --sort-section) #1659

@zyxhere

Description

@zyxhere

Steps to reproduce:

  • wget https://musl.libc.org/releases/musl-1.2.5.tar.gz
  • tar -xf musl-1.2.5.tar.gz
  • cd musl-1.2.5
  • export CFLAGS="-O2" LDFLAGS="-fuse-ld=wild"
  • ./configure && make
gcc -std=c99 -nostdinc -ffreestanding -fexcess-precision=standard -frounding-math -fno-strict-aliasing -Wa,--noexecstack \
-D_XOPEN_SOURCE=700 -I./arch/x86_64 -I./arch/generic -Iobj/src/internal -I./src/include -I./src/internal -Iobj/include -I./include  \
-pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections \
-Wno-pointer-to-int-cast -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith \
-Werror=int-conversion -Werror=incompatible-pointer-types -Werror=discarded-qualifiers -Werror=discarded-array-qualifiers -Waddress \
-Warray-bounds -Wchar-subscripts -Wduplicate-decl-specifier -Winit-self -Wreturn-type -Wsequence-point -Wstrict-aliasing -Wunused-function -Wunused-label -Wunused-variable \
-O2 -Wl,--sort-section,alignment -Wl,--sort-common -Wl,--gc-sections -Wl,--hash-style=both -Wl,--no-undefined -Wl,--exclude-libs=ALL -Wl,--dynamic-list=./dynamic.list -fuse-ld=wild -nostdlib -shared \
[ ... ]
wild: error: unrecognized option(s): --sort-section
collect2: error: ld returned 255 exit status
make: *** [Makefile:162: lib/libc.so] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions