libsdl-org / SDL_ttf

Support for TrueType (.ttf) font files with Simple Directmedia Layer.
zlib License
380 stars 126 forks source link

MSYS2 clang aarch64 build error #298

Closed markand closed 1 year ago

markand commented 1 year ago

Hello,

It looks like there is an lld option that msys2's clang is unable to understand. I don't know what it's used for so I must say that I have no idea what to do in that case:

ninja -v
[1/1] cmd.exe /C "cd . && C:\msys64\clangarm64\bin\cc.exe -Os -DNDEBUG  "-Wl,--version-script=C:/Users/David Demelier/Downloads/SDL_ttf/src/SDL_ttf.sym" -shared -o SDL3_ttf.dll -Wl,--out-implib,libSDL3_ttf.dll.a -Wl,--major-image-version,0,--minor-image-version,0 CMakeFiles/SDL3_ttf-shared.dir/src/SDL_ttf.c.obj CMakeFiles/SDL3_ttf-shared.dir/src/version.rc.obj  C:/msys64/clangarm64/lib/libSDL3.dll.a  C:/msys64/clangarm64/lib/libfreetype.dll.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
FAILED: SDL3_ttf.dll libSDL3_ttf.dll.a
cmd.exe /C "cd . && C:\msys64\clangarm64\bin\cc.exe -Os -DNDEBUG  "-Wl,--version-script=C:/Users/David Demelier/Downloads/SDL_ttf/src/SDL_ttf.sym" -shared -o SDL3_ttf.dll -Wl,--out-implib,libSDL3_ttf.dll.a -Wl,--major-image-version,0,--minor-image-version,0 CMakeFiles/SDL3_ttf-shared.dir/src/SDL_ttf.c.obj CMakeFiles/SDL3_ttf-shared.dir/src/version.rc.obj  C:/msys64/clangarm64/lib/libSDL3.dll.a  C:/msys64/clangarm64/lib/libfreetype.dll.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
lld: error: unknown argument: --version-script=C:/Users/David Demelier/Downloads/SDL_ttf/src/SDL_ttf.sym
cc: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Windows ARM / MSYS2 / clang64 and SDL_ttf commit revision ebeb6a131cdbfa5665ee07042837f79812e917f0

slouken commented 1 year ago

@madebr, we should be checking whether the version script is supported before using it. Any fix we do here should be rolled out across SDL projects.

madebr commented 1 year ago

Fixed in https://github.com/libsdl-org/SDL_ttf/commit/fee14e525f5bd99612b76e2737400d33eddf0595, and pushed to all satellite libraries. Please try again in a fresh build directory (or remove HAVE_WL_VERSION_SCRIPT from your CMakeCache.txt).

markand commented 1 year ago

It works, thanks!