~sircmpwn/public-inbox

1

scdoc build fails on macOS with "ld: library not found for -lcrt0.o"

Marcel Bischoff <marcel@herrbischoff.com>
Details
Message ID
<3A12328E-5EC6-4E34-A676-64A3039A2AF7@herrbischoff.com>
Sender timestamp
1559639844
DKIM signature
missing
Download raw message
### Environment

macOS 10.14.5

### Logs

cc -std=c99 -pedantic -c -o .build/main.o -g -DVERSION='"1.9.4"' -Wall -Wextra -Werror -Wno-unused-parameter -Iinclude src/main.c
cc -std=c99 -pedantic -c -o .build/string.o -g -DVERSION='"1.9.4"' -Wall -Wextra -Werror -Wno-unused-parameter -Iinclude src/string.c
cc -std=c99 -pedantic -c -o .build/utf8_chsize.o -g -DVERSION='"1.9.4"' -Wall -Wextra -Werror -Wno-unused-parameter -Iinclude src/utf8_chsize.c
cc -std=c99 -pedantic -c -o .build/utf8_decode.o -g -DVERSION='"1.9.4"' -Wall -Wextra -Werror -Wno-unused-parameter -Iinclude src/utf8_decode.c
cc -std=c99 -pedantic -c -o .build/utf8_encode.o -g -DVERSION='"1.9.4"' -Wall -Wextra -Werror -Wno-unused-parameter -Iinclude src/utf8_encode.c
cc -std=c99 -pedantic -c -o .build/utf8_fgetch.o -g -DVERSION='"1.9.4"' -Wall -Wextra -Werror -Wno-unused-parameter -Iinclude src/utf8_fgetch.c
cc -std=c99 -pedantic -c -o .build/utf8_fputch.o -g -DVERSION='"1.9.4"' -Wall -Wextra -Werror -Wno-unused-parameter -Iinclude src/utf8_fputch.c
cc -std=c99 -pedantic -c -o .build/utf8_size.o -g -DVERSION='"1.9.4"' -Wall -Wextra -Werror -Wno-unused-parameter -Iinclude src/utf8_size.c
cc -std=c99 -pedantic -c -o .build/util.o -g -DVERSION='"1.9.4"' -Wall -Wextra -Werror -Wno-unused-parameter -Iinclude src/util.c
cc -static -o scdoc .build/main.o .build/string.o .build/utf8_chsize.o .build/utf8_decode.o .build/utf8_encode.o .build/utf8_fgetch.o .build/utf8_fputch.o .build/utf8_size.o .build/util.o
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [scdoc] Error 1
Details
Message ID
<b673bb95-6d5e-c9c7-1c50-3b6ca4457142@biribiri.dev>
In-Reply-To
<3A12328E-5EC6-4E34-A676-64A3039A2AF7@herrbischoff.com> (view parent)
Sender timestamp
1560091190
DKIM signature
missing
Download raw message
On 2019-06-04 5:17 a.m., Marcel Bischoff wrote:
> ### Environment
>
> macOS 10.14.5
>
> [...]
>
> cc -static -o scdoc .build/main.o .build/string.o .build/utf8_chsize.o .build/utf8_decode.o .build/utf8_encode.o .build/utf8_fgetch.o .build/utf8_fputch.o .build/utf8_size.o .build/util.o
> ld: library not found for -lcrt0.o

Try removing `-static` from LDFLAGS in the Makefile. The reason being is 
that on macOS, there isn't a static version of the crt0.o library.

See 
https://stackoverflow.com/questions/3801011/ld-library-not-found-for-lcrt0-o-on-osx-10-6-with-gcc-clang-static-flag 
for details.
Reply to thread Export thread (mbox)