Clang uses wrong include headers when compiling 32 bit on 64 bit ubuntu
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
clang (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
64-bit clang uses 64-bit headers when compiling 32-bit code. GCC works correctly.
This example program reproduces the problem:
#include <fstream>
int main(void)
{
std::ifstream in( "test.dat" );
in.rdbuf(
}
This can then be built with:
#!/bin/bash
BUILD=clang++
#BUILD=g++
$BUILD -m32 -c test.cpp
$BUILD -m32 -v test.o
Which produces a link error with clang but not with gcc:
test.cpp:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
All the above was done on Ubuntu 12.04 64 bit with clang 3.0-6ubuntu3
Could you report upstream too (Debian) ?