#1505 closed defect (fixed)
Premake build broken on OS X
Reported by: | historic_bruno | Owned by: | leper |
---|---|---|---|
Priority: | Release Blocker | Milestone: | Alpha 11 |
Component: | Build & Packages | Keywords: | |
Cc: | leper | Patch: |
Description
Related to r11970 which integrated some changes from Premake 4.4-beta4. A clean build now gives the following error:
Undefined symbols for architecture x86_64: "_Gestalt", referenced from: _os_getversion in os_getversion.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [../../bin/release/premake4] Error 1 make: *** [Premake4] Error 2
It needs to link the CoreServices
framework for Gestalt, used on OS X builds for the new os.getversion()
functionality. The problem is that would break the build on e.g. Linux, presumably one of the reasons why Premake has a separate build/gmake.macosx
directory. There's a few other differences, if we choose to go that route, we could fix the annoying warnings of #1179 at the same time.
Though we need to check to make sure we don't introduce subtle bugs when fixing this, since we bundle a highly modified Premake ;)
Change History (4)
follow-up: 3 comment:1 by , 12 years ago
comment:3 by , 12 years ago
Replying to leper:
The attached patch should link the framework and fix the warnings from #1179. We could generate makefiles for the different systems, but we'd need some logic for that in update-workspaces.sh too, so the sed way doesn't seem that bad.
sed
is yucky, but even if it wasn't, those Makefiles
are auto-generated by Premake, so we're basically avoiding one of the purposes of Premake (which is to generate workspaces for building Premake). Not that the average user needs that, but it's useful in theory when we modify the Premake source. OS detection in update-workspaces.sh
is unavoidable to some extent unless we have separate scripts for building each OS, which we may some day, but I don't see a necessity for sed
.
I think those changes could/should instead be made in premake4.lua.
comment:4 by , 12 years ago
The sed
lines are just that complex, because I wanted to make sure that we don't remove another -s
flag (there is none but there could be one).
I agree that we should also change premake4/premake4.lua, but we'd still need some sed for the BSDs as we need to get rid of the -ldl
, but not on Debian GNU/kFreeBSD. And duplicating the makefiles just because 1-3 parameters differ seems strange.
The attached patch should link the framework and fix the warnings from #1179. We could generate makefiles for the different systems, but we'd need some logic for that in update-workspaces.sh too, so the sed way doesn't seem that bad.
I checked that when commiting r11970 and we don't have that many modifications. I don't know if we still need all of them and I only encountered some merge problems (3 or 4) that aren't easily resolved. We should really try to handle our modifications to premake the same way we do with nvtt, and we should start to submit some of our modifications upstream.