Skip to content
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

New clang 3.4 build can't find includes #19671

Closed
llvmbot opened this issue Apr 1, 2014 · 11 comments
Closed

New clang 3.4 build can't find includes #19671

llvmbot opened this issue Apr 1, 2014 · 11 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla packaging

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 1, 2014

Bugzilla Link 19297
Resolution FIXED
Resolved on Apr 27, 2014 01:18
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor
CC @zygoloid,@sylvestre,@tstellar

Extended Description

I'm running Clang from inside a Docker instance running Ubuntu 12.04. Here's a tiny test case that shows the problem:

root@eacf7e43c75a:~# cat test.c

include_next <limits.h>

In file included from test.c:1:
/usr/include/limits.h:125:16: fatal error: 'limits.h' file not found

include_next <limits.h>

           ^

1 warning and 1 error generated.

root@eacf7e43c75a:# clang -v
Ubuntu clang version 3.4.1-1
exp1 (branches/release_34) (based on LLVM 3.4.1)
Target: x86_64-pc-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.1
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8

However, I have a docker instance I built a couple months ago that's almost entirely the same, except for what I think is a version bump in clang-3.4:

(the following snippet is from the old image, which handles the test case fine)

root@7c57e7415f1d:# clang -v
Ubuntu clang version 3.4-1
exp1 (branches/release_34) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.1
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8

Did something change in how clang looks for include files?

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 1, 2014

assigned to @sylvestre

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 1, 2014

Upon further digging, I believe this is due to clang expecting:

/usr/bin/../lib/clang/3.4.1/include

unfortunately, only

/usr/bin/../lib/clang/3.4/include

exists

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 1, 2014

Even worse, there appears to be a circular symlink loop in the /usr/lib/clang directory. I'd be very grateful for adult supervision!

root@9983b8ac1abe:/usr/lib/clang# ls -al
total 12
drwxr-xr-x 3 root root 4096 Apr 1 00:02 .
drwxr-xr-x 54 root root 4096 Apr 1 00:02 ..
drwxr-xr-x 2 root root 4096 Apr 1 00:02 3.4
lrwxrwxrwx 1 root root 3 Mar 30 00:28 3.4.0 -> 3.4
root@9983b8ac1abe:/usr/lib/clang# ls -al 3.4/
total 8
drwxr-xr-x 2 root root 4096 Apr 1 00:02 .
drwxr-xr-x 3 root root 4096 Apr 1 00:02 ..
lrwxrwxrwx 1 root root 38 Mar 30 00:28 include -> ../../llvm-3.4/lib/clang/3.4.0/include
lrwxrwxrwx 1 root root 34 Mar 30 00:28 lib -> ../../llvm-3.4/lib/clang/3.4.0/lib
root@9983b8ac1abe:/usr/lib/clang#

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Apr 1, 2014

Where did you get your Clang 3.4.1 package from?

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 1, 2014

Where did you get your Clang 3.4.1 package from?

From the usual apt-get repo:

deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.4 main
deb-src http://llvm.org/apt/precise/ llvm-toolchain-precise-3.4 main

apt-get install -y clang-3.4 llvm-3.4

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 1, 2014

Ah, my mistake. The links aren't circular - they're just wrong or missing.

/usr/lib/clang/3.4.1 is not present

/usr/lib/clang/3.4.0 is present but contains
include -> /usr/lib/llvm-3.4/lib/clang/3.4.0/include, which is not present.

There is only /usr/lib/llvm-3.4/lib/clang/3.4 and /usr/lib/llvm-3.4/lib/clang/3.4.1, which contains the proper headers

Symlinking that appears to let my build succeed.

There is however, another wrinkle: /usr/lib/llvm-3.4/lib/clang/3.4/lib appears to be empty. On my "good" installation, this directory contains "linux"

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 14, 2014

Is there an official workaround for this bug or should we just symlink until the bug is resolved?

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 14, 2014

I've been symlinking. I haven't got any sort of official response to the bug yet.

@tstellar
Copy link
Collaborator

I've been symlinking. I haven't got any sort of official response to the bug
yet.

Can you try this patch:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140303/100882.html

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 16, 2014

I've been symlinking. I haven't got any sort of official response to the bug
yet.

Can you try this patch:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140303/100882.
html

Tom, I'm not a very sophisticated user. Is there a doc I can follow about how to compile clang from source with a specified patch?

@sylvestre
Copy link
Collaborator

that should be fixed now.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla packaging
Projects
None yet
Development

No branches or pull requests

3 participants