[cfe-dev] Clang Linux driver - header directories for wrong architecture are selected for -m32

Aleksei Sidorin a.sidorin at samsung.com
Mon May 5 06:52:54 PDT 2014


Hello,

This patch breaks some other tests so I was not sure if it is OK to use 
Phabricator. But there were some questions to those tests. Anyway, I've 
created a review.

Example I found in test (linux-ld.c):

//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i386-unknown-linux -m64 \
// RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-32-TO-64 %s
// CHECK-32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK-32-TO-64: 
"{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0/64{{/|\\\\}}crtbegin.o"
// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/64"
// CHECK-32-TO-64: 
"-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib/../lib64"
// CHECK-32-TO-64: 
"-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../lib64"
// CHECK-32-TO-64: "-L[[SYSROOT]]/lib/../lib64"
// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64"
// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0"
// CHECK-32-TO-64: 
"-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib"
// CHECK-32-TO-64: 
"-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.."
// CHECK-32-TO-64: "-L[[SYSROOT]]/lib"
// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib"

Is it OK to use both 
"-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" (that has 32-bit 
object files inside) and 
"-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/64" (that has 64-bit 
object files)? There are some similar test failures. There were also 
some failures on MIPS64 tests where I don't know if it is correct or not.

30.04.2014 23:01, Jonathan Roelofs пишет:
>
>
> On 4/30/14, 5:40 AM, Simon Atanasyan wrote:
>> Hi,
>>
>> On Wed, Apr 30, 2014 at 2:46 PM, Aleksei Sidorin 
>> <a.sidorin at samsung.com> wrote:
>>> I have a problem with current Clang master: it selects x64 headers for
>>> 32-bit architecture and it leads to compiler errors.
>>> I have Ubuntu 14.04 with GCC-4.8.2 and 4.6.4 installed + multilib. 
>>> Clang 3.5
>>> (master) doesn't add "/32" suffixes if "-m32" option is specified.
>>
>> 1. Could you consider to use Phabricator (http://reviews.llvm.org/)
>> for the patch submitting?
> Aleksei, please add me to the review when you do.
>> 2. Could you add any test case to the patch to reproduce the bug? The
>> following commit has the driver test case example:
>> http://llvm.org/viewvc/llvm-project?rev=202873&view=rev
>> 3. Very minor note - there is a typo in the variable name "NewSubling".
>>
>> Regards,
>> Simon
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>


-- 
Best regards,
Aleksei Sidorin
Software Engineer,
IMSWL-IMCG, SRR, Samsung Electronics




More information about the cfe-dev mailing list