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

Genie Generating Incorrect Linker Flags for MacOS and Android Building #3343

Open
GEMISIS opened this issue Aug 25, 2024 · 0 comments
Open

Comments

@GEMISIS
Copy link

GEMISIS commented Aug 25, 2024

Describe the bug
When building the Android target on an M-series MacBook Pro, Genie is generating incorrect makefiles with wrong linker flags on the shared library builds. It is specifically adding a -dynamiclib flag when it should be a -shared flag in bgfx-shared-lib.make.

To Reproduce
Steps to reproduce the behavior (Note: requires MacBook Pro):

  1. Run make android-arm64
  2. Note the error

Expected behavior
Build is successful

Actual behavior
Failed build with the following error message:

Linking bgfx-shared-lib
clang++: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument]
ld.lld: error: undefined symbol: main
>>> referenced by crtbegin.c
>>>               /Users/gemisis/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android/32/crtbegin_dynamic.o:(_start_main)
>>> referenced by crtbegin.c
>>>               /Users/gemisis/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android/32/crtbegin_dynamic.o:(_start_main)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../../android-arm64/bin/libbgfx-shared-libDebug.so] Error 1
make[1]: *** [bgfx-shared-lib] Error 2
make: *** [android-arm64-debug] Error 2

Screenshots
image

Additional context

  • Building for Android 64-bit devices
  • Running on an M3 Max MacBook Pro
  • Changing from -dynamiclib to -shared manually after projgen successfully builds, but is not a proper fix.
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

1 participant