#1463 closed defect (fixed)
Add support for OpenBSD
Reported by: | Anthony J. Bentley | Owned by: | leper |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 11 |
Component: | Build & Packages | Keywords: | |
Cc: | Patch: |
Description (last modified by )
Make these libraries compile on OpenBSD and fix all remaining issues.
FCollada r11936
nvtt r11962 upstream bug reportSpiderMonkey
r11942
Attachments (5)
Change History (27)
by , 11 years ago
Attachment: | 0ad-openbsd-build.txt added |
---|
comment:2 by , 11 years ago
You probably need to search for __FreeBSD__
in all the FCollada source files and add a check for __OpenBSD__
as well. I don't know if that will fix this particular error but it's likely required for a successful build.
comment:3 by , 11 years ago
You're right, it doesn't fix this particular error, but I'll attach the patch anyway. Initial problem is still present.
comment:4 by , 11 years ago
In FCollada/FUtils/FUStringBuilder.h
, change line 138 to:
#elif defined(__APPLE__) || defined(__OpenBSD__)
which makes sense if it works, since OS X builds on BSD in many respects (not sure why this fix isn't required on FreeBSD as well...)
comment:5 by , 11 years ago
That fix (combined with the patch I attached above) allows FCollada to build on OpenBSD. Thanks.
comment:6 by , 11 years ago
Good to hear :) How does the rest of the build go? If that's all we need, I'll commit the fixes.
comment:7 by , 11 years ago
Keywords: | patch review added |
---|---|
Milestone: | Backlog → Alpha 11 |
Priority: | Should Have → Nice to Have |
Summary: | error: call of overloaded 'append(const long unsigned int&)' is ambiguous → [PATCH] error: call of overloaded 'append(const long unsigned int&)' is ambiguous |
comment:8 by , 11 years ago
Spidermonkey won't configure unless I pass --disable-tracejit to it. When that's done, the build fails here:
c++ -o jsnativestack.o -c -I./dist/system_wrappers_js -include ../config/gcc_hidden.h -DOSTYPE=\"OpenBSD5\" -DOSARCH=OpenBSD -DEXPORT_JS_API -D__STDC_LIMIT_MACROS -I.. -I. -I./dist/include -I./dist/include/nsprpub -I.. -I../assembler -I../yarr -fPIC -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long -fno-strict-aliasing -pthread -pipe -DDEBUG -D_DEBUG -DTRACING -g -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 -DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/jsnativestack.pp ../jsnativestack.cpp ../jsnativestack.cpp: In function 'void* js::GetNativeStackBaseImpl()': ../jsnativestack.cpp:207: error: 'pthread_getattr_np' was not declared in this scope gmake[1]: *** [jsnativestack.o] Error 1 gmake[1]: *** Waiting for unfinished jobs.... gmake[1]: Leaving directory
I currently tell 0ad to use the system spidermonkey (1.9.2.16). No doubt this will cause errors later on down the line.
nvtt doesn't build either. I opened a bug upstream: https://code.google.com/p/nvidia-texture-tools/issues/detail?id=176
comment:10 by , 11 years ago
Description: | modified (diff) |
---|---|
Keywords: | patch review removed |
Summary: | [PATCH] error: call of overloaded 'append(const long unsigned int&)' is ambiguous → Add support for OpenBSD |
Thanks for the patch. I modified the ticket to add support for OpenBSD. I'll probably give the remaining issues a try in the next days, but if you have some other patches just add them here.
comment:11 by , 11 years ago
The SpiderMonkey build failure is fixed upstream (so we just need to add a patch to our version).
The nano-jit one is probably https://bugzilla.mozilla.org/show_bug.cgi?id=633857
comment:13 by , 11 years ago
Description: | modified (diff) |
---|
by , 11 years ago
Attachment: | more_openbsd_compat.diff added |
---|
follow-up: 15 comment:14 by , 11 years ago
The attached work in progress patch makes nvtt build (based on anthonyjbentley's patch) and disables asynchronous IO (as OpenBSD doesn't provide the POSIX.1b aio.h header. Some of the changes to premake aren't cleaned up and I won't commit them in this state, but I added the patch so you can test some more.
What should be changed is the linking of rt on BSD systems (as at least on OpenBSD this isn't needed). I'm currently having a linking problem due to some undefined symbols in a vorbis lib.
follow-up: 16 comment:15 by , 11 years ago
Replying to leper:
What should be changed is the linking of rt on BSD systems (as at least on OpenBSD this isn't needed).
I didn't notice a problem there on FreeBSD. The only remaining build problems I know of on FreeBSD are missing ecvt()
in FCollada and build/gmake.unix/Premake4.make
linking dl
which causes an error - but apparently that's needed on GNU/kFreeBSD. It seems every BSD requires a slightly different build config, which is inconvenient and Premake currently makes no distinction between them :(
comment:16 by , 11 years ago
It's running: http://ompldr.org/vZTZzYw (I assume the textures are still loading and that may take some time and also it is using the mesa software renderer and a VM isn't the best possible environment for a 3D game ;-) )
Replying to historic_bruno:
It seems every BSD requires a slightly different build config, which is inconvenient and Premake currently makes no distinction between them :(
I added some os type detection to premake so that we can differentiate between the various BSD versions. I also added detection of BSD systems to update-workspaces.sh to not link with dl (except GNU/kFreeBSD).
Executing pyrogenesis still needs some manual intervention to preload libogg and libvorbis as otherwise we get undefined symbol errors.
I still need to clean up my changes but I'll add a working patch in the next days.
by , 11 years ago
Attachment: | openbsd.diff added |
---|
by , 11 years ago
Attachment: | premake_backport.diff added |
---|
comment:18 by , 11 years ago
premake_backport.diff includes premake4.4's os.getversion() and extends that to work on POSIX-compilant systems. I'll probably adjust the other patch to work with this and commit this soon.
comment:20 by , 11 years ago
Description: | modified (diff) |
---|
Some remaining issues (though I don't think they are big enough to keep this ticket open):
OpenBSDs packaged libxml is built without threading support and atlas depends on that, so you should run update-workspaces.sh with --disable-atlas .
You probably need to run pyrogenesis with LD_PRELOAD=/usr/local/lib/libogg.so.6.2:/usr/local/lib/libvorbis.so.8.0 as those aren't linked (see the TODO in extern_libs4.lua)
Also you need to symlink libmozjs185-ps-release.so.1.0 to libmozjs185-ps-release.so.1.0.1.0 (I'd really like to know why...)
Apart from that it should work (though I've only tested it in a VM). There is one test failure that is already covered by #1142.
comment:21 by , 11 years ago
Thanks for the work you've put into this. The game does build and run, though textures take several minutes to load even on real hardware.
I'll see what I can do about getting this packaged, and also enabling threads in libxml.
comment:22 by , 11 years ago
I added OpenBSD to our BuildInstructions. If I missed a dependency just add it there.
Full build log