-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix build on Ubuntu #2001
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
fix build on Ubuntu #2001
Conversation
Can you explain why this doesn't work in Ubuntu? That static assert is protecting the kfreebsd target. What is the compile error you are getting? Also what version of ubuntu? |
It appears that Ubuntu (and IIRC Debian) removed KFreeBSD from llvm [1/3] Building CXX object CMakeFiles/zig_cpp.dir/src/zig_llvm.cpp.o FAILED: CMakeFiles/zig_cpp.dir/src/zig_llvm.cpp.o /usr/bin/c++ -I../deps/lld/include -I/usr/lib/llvm-7/include -I../deps/SoftFloat-3e/source/include -I../ -I. -I../src -g -std=c++11 -Werror -Wall -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -fno-exceptions -fno-rtti -Werror=strict-prototypes -Werror=old-style-definition -Werror=type-limits -Wno-missing-braces -MD -MT CMakeFiles/zig_cpp.dir/src/zig_llvm.cpp.o -MF CMakeFiles/zig_cpp.dir/src/zig_llvm.cpp.o.d -o CMakeFiles/zig_cpp.dir/src/zig_llvm.cpp.o -c ../src/zig_llvm.cpp ../src/zig_llvm.cpp:1032:59: error: ‘KFreeBSD’ is not a member of ‘llvm::Triple’ static_assert((Triple::OSType)ZigLLVM_KFreeBSD == Triple::KFreeBSD, ""); ^~~~~~~~ ninja: build stopped: subcommand failed.
f95def4
to
3a0f29e
Compare
It appears that Ubuntu removed KFreeBSD from llvm |
This is Ubuntu 19.04, but I also experienced this on Ubuntu 18.10 |
Here's the way I see this: Ubuntu has mangled their LLVM package and it is no longer suitable to build Zig. At first my response is to say, sorry, Ubuntu LLVM packages are not supported, because they have patched out an OS that Zig supports. However I looked up more details about kFreeBSD and it appears to be discontinued due to not being popular enough. So, I think an acceptable course of action is to remove kFreeBSD from the list of Zig supported OS targets. This would mean we can drop the static assert and Ubuntu's LLVM package will satisfy Zig's requirements. So to solve this, this pull request needs to fully remove kFreeBSD as one of Zig's supported targets. That work will be in target.cpp and target.hpp, and then it will have to be removed from I would also like to file a bug report with Debian and/or Ubuntu in their LLVM package for doing this. And finally, as a workaround, one can build LLVM from source, or use http://apt.llvm.org/. And as always, the static builds on ziglang.org/download will continue to work for Ubuntu users. |
I'd like to push back on Ubuntu with this. Why did they remove the kfreebsd target? |
Not sure why this is now broken, but it isn't a big deal to take this test out.