[llvm-bugs] [Bug 31264] New: clang's gcc-toolchain flag seems not working
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Dec 5 04:25:10 PST 2016
https://llvm.org/bugs/show_bug.cgi?id=31264
Bug ID: 31264
Summary: clang's gcc-toolchain flag seems not working
Product: clang
Version: 3.8
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Driver
Assignee: unassignedclangbugs at nondot.org
Reporter: taenaru at gmail.com
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
Created attachment 17709
--> https://llvm.org/bugs/attachment.cgi?id=17709&action=edit
Hello World application build with clang --gnu-toolchain=$(TOOLCHAIN_PATH)
Hello,
I have met an issue with the "--gcc-toolchain" flag. As I understand that
option , it is intended to be used when we want to point out to clang where
necessary external GCC utilities are (like linker, assembler stuff, etc.).
I tried to use ARM GCC toolchain with clang, but it seemed that
"--gcc-toolchain" worked only during compilation. There is the output below:
System info:
OS: Linux ubuntu 4.8.0-27-generic #29-Ubuntu SMP Thu Oct 20 21:03:13 UTC 2016
x86_64 x86_64 x86_64 GNU/Linux
Clang: clang version 3.8.1-12ubuntu1 (tags/RELEASE_381/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
ARM GCC: arm-linux-gnueabihf-gcc (Linaro GCC 6.1-2016.08) 6.1.1 20160711
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
GCC toolchain used:
https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabihf.tar.xz
# TOOLCHAIN_PATH = /home/vpetrigo/gcc-x86_64-arm-linux-gnueabihf
#
# content of the gcc-x86_64-arm-linux-gnueabihf folder:
# arm-linux-gnueabihf/
# bin/
# include/
# lib/
# libexec/
# share/
Here I have a simple "Hello World" application:
# main.c content
#include <stdio.h>
int main() {
printf("Hello world\n");
return 0;
}
I tried to invoke the clang like this:
`clang -target arm-linux-gnueabihf
--sysroot=/home/vpetrigo/gcc-x86_64-arm-linux-gnueabihf/arm-linux-gnueabihf/libc
--gcc-toolchain=/home/vpetrigo/gcc-x86_64-arm-linux-gnueabihf main.c -o main
-v`
The output is inside the attachment (see output.log)
As you can see during the linkage state /usr/bin/ld was used. But I provide the
valid toolchain path and there is `arm-linux-gnueabihf-ld` executable inside
the bin/ subfolder.
If I make a symlink of `arm-linux-gnueabihf-ld` and put it into the /usr/bin
folder, building works fine then.
Could you tell me if I misunderstand that flag and all necessary GCC utils must
be in the /usr/bin folder?
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161205/3b6b7122/attachment.html>
More information about the llvm-bugs
mailing list