-
Notifications
You must be signed in to change notification settings - Fork 68
fix CMake build #17
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 CMake build #17
Conversation
|
Awesome, just what I was hoping for, thank you! :) Unfortunately, I'm running into a problem that seems to come down to a missing file "systemIncludePath.c.tmpl"--is that possible or does that mean I'm doing something else wrong? |
|
Missed the stray LICENSE.txt, thanks for cleaning up. I'm trying to build on Ubuntu 16.10 with the typical packages installed:
and cmake complains that it can't find |
|
A Classic. I forgot to add the template. |
|
This has been a known issue on Ubuntu's side for a little over 2 years. Do you know how you want to proceed with this? |
|
I mean, what does the statement around building fcd with CMake become? You can't build fcd if you've installed Clang through Ubuntu/Debian's package manager? Should fcd bundle a ClangConfig.cmake that matches the Debian/Ubuntu official distributions? |
|
Now linking it manually, expecting the clang libs in the same folder as the llvm ones. |
|
Wait–the newer Ubuntu/Debian packages do include ClangConfig, just in a different location. Sorry about that. (For the record, and since that may come in handy when updating INSTALL, the files are The next issue with the packaged installation is that the actual names of the compilers are I'm trying to see if the guys who package Clang for Debian an Ubuntu have anything to say on that matter, but if you have an idea, you're free to try it as well. The Makefile currently expects that there will be a suffix to Clang, which is not much better, I guess. |
|
Another option (567a25f) is to just build everything with clang (as it is needed to compile some files anyway) and let the user set it via |
|
This is basically what the package maintainers said that you should do. It should probably check that the Clang version is 3.9 as well. Unless you want to sign up for it, right now, no one regularly builds fcd on Linux. I build with AppleClang, which lags behind the latest and greatest that we're now forcing Linux people to use, which quite possibly turn on more warnings/detecting more violations. This makes warnings as errors a moving target on a platform that receives less attention, and that will quickly become a problem. I'm not interested in getting build fail bugs for warnings, or discouraging people from using fcd because a problem that has a 90% chance of being benign was reported by the compiler. |
|
Sure. Though a Travis build or something similar would still be a good idea. |
|
I'm looking into that. The biggest reason that I've held off is that fcd's output is not stable across runs (most likely because it uses ASLR'd pointers for keys to a bunch of I'm still not a big fan of warnings as errors. Also, I'd suggest making |
|
I've set up Travis. You can merge with master and check if the PR works in a world where people have installed LLVM through their package manager. |
2eba43a to
528c9b8
Compare
|
Looks like it hangs if somethings goes wrong. |
|
To be clear, it doesn't hang, it's just the macOS build that takes 45 minutes to prop. (See what you signed me up for? 😉) Luckily for you, the Linux build is much faster, but you need to check individual builds for status, not the whole thing. They run Ubuntu 12.04 on sudo-less machines and 14.04 on machines that are sudo-enabled. This is the one that we have. The If you get to "bad decrypt", it means that you got it: that's Travis failing to decrypt the fcd-tests's repository private key because it would be kind of broken if it just let you pretend that you were me. |
|
You could need a trick similar to http://libcxx.llvm.org/docs/UsingLibcxx.html but using libstdc++. For reference, the paths are |
|
I see Ubuntu 12 with GCC 4.6 in the log: |
|
You're right, I overlooked that you can get a 12.04 environment even on a sudo build (in fact, I mix Trusty and Precise packages in the .travis.yml file). |
|
The |
|
It didn't, so I spun up a 12.04 VM to see what was wrong. Turns out that libstdc++6, which is installed as a requirement for llvm-3.9, does not include The first next error is:
That's not my area of expertise, but I'm assuming that it's a simple-ish directive error in the CMakeList file. The second error is:
As I think that I mentioned before, this happens most likely because you made the |
833b2e0 to
62ee311
Compare
|
Looks like what doesn't work on Travis is my fault now. I'm still getting this error on 12.04 though:
Looking closer, it's because the
Changing the extension from .asm to the better-known .s fixed the problem. There is an issue with how I use the
I'm running out of time and will look at it later. |
|
I don't have solid evidence for it, but my best lead so far is that the output links against both the static and dynamic libraries of LLVM: You're possibly missing a Also, |
|
Yes, replacing all LLVM .a libs with |
|
There is no llvm-config invocation. Just the exported cmake config file. |
|
On this installation, the Clang shared library is what pulls in the LLVM shared library. That does not appear to systematically be the case: for instance, the macOS Clang shared library doesn't. I'm successfully getting around the problem with this: This also adds a small number of static libraries to the list, because the static Clang libraries need symbols that were otherwise pulled from the LLVM shared library that the Clang shared library brought in. No idea how that builds on systems where it doesn't do that. The result executable is broken in a different way (it systematically crashes inside of |
|
Why would that make a difference if libclang is linked against libllvm? We don't even call any functions from it. |
|
I don't know why the state of libLLVM leaks into the state of fcd when fcd links against static libraries. It seems to me that they shouldn't interact, unless the linker always prefers symbols from shared libraries when it can find them in both static and shared libraries. The reason the libLLVM code gets executed even though we never execute anything from libclang, though, is that command-line option registration, among many other things with LLVM, happens in the constructor of global variables. These are always executed regardless of what else you'd do with the library. I'm not opposed to finding a different solution to get Clang resources. However, I can't think of one. |
|
In the meantime, I get a working executable out of the CMake build on Ubuntu 16.04, so the issues appear to be specific to how we try to build on Trusty. My best bet is that the LLVM binaries were built with a different libstdc++ that has an incompatible string layout. In fact, on Trusty, the LLVM apt packages are happy depending on just libstdc++ 4.8. If that's the case on Precise too, then trying to link fcd against libstdc++ 6 when LLVM links against 4.8 is sure to cause problems. The other thing is that libstdc++ 4.8 is not C++14-ready. It doesn't have |
|
The |
|
Looks like it's possible to use 16.04 via Docket rust-lang/rust#34016 |
|
You know that I agree. However, I spent about as much time as I was willing to spend on this at the moment. |
|
Yeah me too. I guess let's go with this :) |
|
I've manually merged your master branch into this repo's |
fix #28