ioquake / ioq3

The ioquake3 community effort to continue supporting/developing id's Quake III Arena
https://ioquake3.org/
GNU General Public License v2.0
2.43k stars 530 forks source link

Mac build failing suddenly, malformed universal file libSDL2 #566

Closed futurepr0n closed 1 year ago

futurepr0n commented 2 years ago

When I issue the command to make: ./make-macosx.sh x86_64

I am getting errors:

...
CGAME_Q3LCC_MISSIONPACK code/cgame/cg_particles.c
CGAME_Q3LCC_MISSIONPACK code/cgame/cg_players.c
CGAME_Q3LCC_MISSIONPACK code/cgame/cg_playerstate.c
ld: malformed universal file: slice content is not mach-o or a static library file 'code/libs/macosx/libSDL2-2.0.0.dylib'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
CGAME_Q3LCC_MISSIONPACK code/cgame/cg_predict.c
make[2]: *** [build/release-darwin-x86_64/ioquake3.x86_64] Error 1
make[2]: *** Waiting for unfinished jobs....
ld: malformed universal file: slice content is not mach-o or a static library file 'code/libs/macosx/libSDL2-2.0.0.dylib'
CGAME_Q3LCC_MISSIONPACK code/cgame/cg_scoreboard.c
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [build/release-darwin-x86_64/renderer_opengl1_x86_64.dylib] Error 1
ld: malformed universal file: slice content is not mach-o or a static library file 'code/libs/macosx/libSDL2-2.0.0.dylib'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [build/release-darwin-x86_64/renderer_opengl2_x86_64.dylib] Error 1
rm build/release-darwin-x86_64/renderergl2/glsl/texturecolor_fp.c build/release-darwin-x86_64/renderergl2/glsl/texturecolor_vp.c build/release-darwin-x86_64/renderergl2/glsl/tonemap_vp.c build/release-darwin-x86_64/renderergl2/glsl/lightall_vp.c build/release-darwin-x86_64/renderergl2/glsl/generic_fp.c build/release-darwin-x86_64/renderergl2/glsl/generic_vp.c build/release-darwin-x86_64/renderergl2/glsl/bokeh_vp.c build/release-darwin-x86_64/renderergl2/glsl/fogpass_vp.c build/release-darwin-x86_64/renderergl2/glsl/depthblur_fp.c build/release-darwin-x86_64/renderergl2/glsl/depthblur_vp.c build/release-darwin-x86_64/renderergl2/glsl/shadowmask_fp.c build/release-darwin-x86_64/renderergl2/glsl/shadowfill_fp.c build/release-darwin-x86_64/renderergl2/glsl/dlight_fp.c build/release-darwin-x86_64/renderergl2/glsl/dlight_vp.c build/release-darwin-x86_64/renderergl2/glsl/lightall_fp.c build/release-darwin-x86_64/renderergl2/glsl/calclevels4x_fp.c build/release-darwin-x86_64/renderergl2/glsl/calclevels4x_vp.c build/release-darwin-x86_64/renderergl2/glsl/bokeh_fp.c build/release-darwin-x86_64/renderergl2/glsl/shadowmask_vp.c build/release-darwin-x86_64/renderergl2/glsl/shadowfill_vp.c build/release-darwin-x86_64/renderergl2/glsl/fogpass_fp.c build/release-darwin-x86_64/renderergl2/glsl/tonemap_fp.c build/release-darwin-x86_64/renderergl2/glsl/pshadow_fp.c build/release-darwin-x86_64/renderergl2/glsl/ssao_fp.c build/release-darwin-x86_64/renderergl2/glsl/ssao_vp.c build/release-darwin-x86_64/renderergl2/glsl/pshadow_vp.c build/release-darwin-x86_64/renderergl2/glsl/down4x_fp.c build/release-darwin-x86_64/renderergl2/glsl/down4x_vp.c
make[1]: *** [targets] Error 2
make: *** [release] Error 2

I used to have no problem building, but that was back some Mac OS versions ago. I am not sure if that has anything to do with it, but I have since updated command line tools, brew update & upgrade, and still have not been able to resolve the issue. I have also not had much luck searching google unfortunately.

I have been successful in the past, I was just getting back to some quake programming after a break (reading through the Focus on Quake 3 Mod Programming book). I have been successfully building samples and getting things to work up until chapter 4 of the book - however I wanted to revisit everything and start fresh and started getting this error immediately after removing an build/ and trying to re-make.

tomkidd commented 2 years ago

Yeah this happened with one of the revisions to Xcode. Something about the way I constructed the dylib with four architectures made it unhappy. I'm trying to figure out the best way to proceed but I've had stuff come up.

In the meantime maybe try replacing the dylib with the one before I started messing with it. Since you're just doing x86_64 and not arm64 it might suffice

https://github.com/ioquake/ioq3/raw/5bf60a95041bce7b1f42fdf1a4550b57bf83da47/code/libs/macosx/libSDL2-2.0.0.dylib

futurepr0n commented 2 years ago

Thanks, I did try that but It did not seem to do the trick.

LD build/release-darwin-x86_64/missionpack/qagamex86_64.dylib
LD build/release-darwin-x86_64/tools/q3rcc
ld: malformed universal file: slice content is not mach-o or a static library file 'code/libs/macosx/libSDL2-2.0.0.dylib'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [build/release-darwin-x86_64/ioquake3.x86_64] Error 1
make[2]: *** Waiting for unfinished jobs....
ld: malformed universal file: slice content is not mach-o or a static library file 'code/libs/macosx/libSDL2-2.0.0.dylib'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [build/release-darwin-x86_64/renderer_opengl1_x86_64.dylib] Error 1
ld: malformed universal file: slice content is not mach-o or a static library file 'code/libs/macosx/libSDL2-2.0.0.dylib'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [build/release-darwin-x86_64/renderer_opengl2_x86_64.dylib] Error 1
rm build/release-darwin-x86_64/renderergl2/glsl/texturecolor_fp.c build/release-darwin-x86_64/renderergl2/glsl/texturecolor_vp.c build/release-darwin-x86_64/renderergl2/glsl/tonemap_vp.c build/release-darwin-x86_64/renderergl2/glsl/lightall_vp.c build/release-darwin-x86_64/renderergl2/glsl/generic_fp.c build/release-darwin-x86_64/renderergl2/glsl/generic_vp.c build/release-darwin-x86_64/renderergl2/glsl/bokeh_vp.c build/release-darwin-x86_64/renderergl2/glsl/fogpass_vp.c build/release-darwin-x86_64/renderergl2/glsl/depthblur_fp.c build/release-darwin-x86_64/renderergl2/glsl/depthblur_vp.c build/release-darwin-x86_64/renderergl2/glsl/shadowmask_fp.c build/release-darwin-x86_64/renderergl2/glsl/shadowfill_fp.c build/release-darwin-x86_64/renderergl2/glsl/dlight_fp.c build/release-darwin-x86_64/renderergl2/glsl/dlight_vp.c build/release-darwin-x86_64/renderergl2/glsl/lightall_fp.c build/release-darwin-x86_64/renderergl2/glsl/calclevels4x_fp.c build/release-darwin-x86_64/renderergl2/glsl/calclevels4x_vp.c build/release-darwin-x86_64/renderergl2/glsl/bokeh_fp.c build/release-darwin-x86_64/renderergl2/glsl/shadowmask_vp.c build/release-darwin-x86_64/renderergl2/glsl/shadowfill_vp.c build/release-darwin-x86_64/renderergl2/glsl/fogpass_fp.c build/release-darwin-x86_64/renderergl2/glsl/tonemap_fp.c build/release-darwin-x86_64/renderergl2/glsl/pshadow_fp.c build/release-darwin-x86_64/renderergl2/glsl/ssao_fp.c build/release-darwin-x86_64/renderergl2/glsl/ssao_vp.c build/release-darwin-x86_64/renderergl2/glsl/pshadow_vp.c build/release-darwin-x86_64/renderergl2/glsl/down4x_fp.c build/release-darwin-x86_64/renderergl2/glsl/down4x_vp.c
make[1]: *** [targets] Error 2
make: *** [release] Error 2
futurepr0n@Marks-MacBook-Pro ioq3 % 

Everything was working for me but I had not touched it for some time now. Damn, I hate Mac updates... so much stuff seems to break

All I did was put your file to replace the one in code/libs/macosx/libSDL2-2.0.0.dylib and removed the build/ and re-ran the ./make-macosx.sh x86_64

If you come across any suggestions im thankful for any help, appreciate the try!

futurepr0n commented 2 years ago

This issue can be closed when https://github.com/ioquake/ioq3/pull/573 is merged - I can validate that its successful after those changes are applied.