Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on macOS: make: objcopy: No such file or directory #140

Open
snej opened this issue Mar 7, 2024 · 2 comments
Open

Build fails on macOS: make: objcopy: No such file or directory #140

snej opened this issue Mar 7, 2024 · 2 comments

Comments

@snej
Copy link

snej commented Mar 7, 2024

Cloned the repo and ran make:

cc -std=c99 -O3 -Wall -Wextra -pedantic -DBASE64_STATIC_DEFINE -o bin/base64.o -c bin/base64.c
bin/base64.c:544:10: warning: missing field 'has_arg' initializer [-Wmissing-field-initializers]
                { NULL }
                       ^
1 warning generated.
cp -f lib/exports.txt lib/exports.build.txt
cc -std=c99 -O3 -Wall -Wextra -pedantic -DBASE64_STATIC_DEFINE -Ilib  -o lib/arch/avx512/codec.o -c lib/arch/avx512/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -DBASE64_STATIC_DEFINE -Ilib  -o lib/arch/avx2/codec.o -c lib/arch/avx2/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -DBASE64_STATIC_DEFINE -Ilib -o lib/arch/generic/codec.o -c lib/arch/generic/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -DBASE64_STATIC_DEFINE -Ilib  -o lib/arch/neon32/codec.o -c lib/arch/neon32/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -DBASE64_STATIC_DEFINE -Ilib  -o lib/arch/neon64/codec.o -c lib/arch/neon64/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -DBASE64_STATIC_DEFINE -Ilib  -o lib/arch/ssse3/codec.o -c lib/arch/ssse3/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -DBASE64_STATIC_DEFINE -Ilib  -o lib/arch/sse41/codec.o -c lib/arch/sse41/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -DBASE64_STATIC_DEFINE -Ilib  -o lib/arch/sse42/codec.o -c lib/arch/sse42/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -DBASE64_STATIC_DEFINE -Ilib  -o lib/arch/avx/codec.o -c lib/arch/avx/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -DBASE64_STATIC_DEFINE -Ilib -o lib/lib.o -c lib/lib.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -DBASE64_STATIC_DEFINE -Ilib -o lib/codec_choose.o -c lib/codec_choose.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -DBASE64_STATIC_DEFINE -Ilib -o lib/tables/tables.o -c lib/tables/tables.c
ld -r -o lib/libbase64.o lib/arch/avx512/codec.o lib/arch/avx2/codec.o lib/arch/generic/codec.o lib/arch/neon32/codec.o lib/arch/neon64/codec.o lib/arch/ssse3/codec.o lib/arch/sse41/codec.o lib/arch/sse42/codec.o lib/arch/avx/codec.o lib/lib.o lib/codec_choose.o lib/tables/tables.o
objcopy --keep-global-symbols=lib/exports.build.txt lib/libbase64.o
make: objcopy: No such file or directory
make: *** [lib/libbase64.o] Error 1

Never heard of objcopy before; looks like it's part of a GNU Binary Utilities library. I'm not sure if this tool supports macOS, i.e. Mach-O executables, or how to install it if it does.

(I'm running macOS 14.3.1 on an M1 MacBook Pro.)

@snej
Copy link
Author

snej commented Mar 7, 2024

I just noticed that CMake is supported, and builds fine for me, so I'll be using that instead of make. It would still be nice if the Makefile were made compatible.

@aklomp
Copy link
Owner

aklomp commented Mar 10, 2024

The objcopy step is not really necessary and can be commented out. It hides any symbols not listed in lib/exports.build.txt, so that internal symbols are not exposed by accident.

The objcopy step is a bit of a hack and shouldn't be necessary once symbol visibility is handled by good design and language features. See also #54.

Keeping this issue open as a reminder that the Makefile build is broken on MacOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants