* using clang for one recipe
@ 2017-06-23 22:39 Trevor Woerner
2017-06-23 22:57 ` Khem Raj
0 siblings, 1 reply; 4+ messages in thread
From: Trevor Woerner @ 2017-06-23 22:39 UTC (permalink / raw)
To: yocto@yoctoproject.org, Khem Raj
I want to have one recipe build with clang instead of gcc (gcc is
being used for the rest of the image). I thought this was as simple as
adding the following line to the recipe:
TOOLCHAIN = "clang"
Adding that line, and adding meta-clang to bblayers.conf, did get the
llvm/clang compiler built and installed to recipe-sysroot-native. But
the moment it starts to build the package, it fails immediately with:
| fatal error: 'string' file not found
| #include <string>
| ^~~~~~~~
Did I miss a step? That seems like a pretty basic thing that would be
needed for using a toolchain. If feels like I'm missing something;
like I need to add something else to my local.conf. Thoughts?
Suggestions?
I went looking for examples of recipes using clang and found
meta-openembedded/meta-oe/recipes-support/tbb.bb which includes:
COMPILER ?= "gcc"
COMPILER_toolchain-clang = "clang"
Odd. Why "COMPILER" and not "TOOLCHAIN" like meta-clang's README mentions?
Best regards,
Trevor
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: using clang for one recipe
2017-06-23 22:39 using clang for one recipe Trevor Woerner
@ 2017-06-23 22:57 ` Khem Raj
2017-06-24 1:55 ` Trevor Woerner
0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2017-06-23 22:57 UTC (permalink / raw)
To: Trevor Woerner; +Cc: yocto@yoctoproject.org
On Fri, Jun 23, 2017 at 3:39 PM, Trevor Woerner <twoerner@gmail.com> wrote:
> I want to have one recipe build with clang instead of gcc (gcc is
> being used for the rest of the image). I thought this was as simple as
> adding the following line to the recipe:
>
> TOOLCHAIN = "clang"
yes thats what should do it.
>
> Adding that line, and adding meta-clang to bblayers.conf, did get the
> llvm/clang compiler built and installed to recipe-sysroot-native. But
> the moment it starts to build the package, it fails immediately with:
>
> | fatal error: 'string' file not found
> | #include <string>
> | ^~~~~~~~
>
> Did I miss a step? That seems like a pretty basic thing that would be
> needed for using a toolchain. If feels like I'm missing something;
> like I need to add something else to my local.conf. Thoughts?
> Suggestions?
which package is it ? it seems its missing proper -I paths.?
>
> I went looking for examples of recipes using clang and found
> meta-openembedded/meta-oe/recipes-support/tbb.bb which includes:
>
> COMPILER ?= "gcc"
> COMPILER_toolchain-clang = "clang"
>
> Odd. Why "COMPILER" and not "TOOLCHAIN" like meta-clang's README mentions?
this is tbb specific variable not clang or gcc specific.
>
> Best regards,
> Trevor
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: using clang for one recipe
2017-06-23 22:57 ` Khem Raj
@ 2017-06-24 1:55 ` Trevor Woerner
2017-06-24 2:45 ` Khem Raj
0 siblings, 1 reply; 4+ messages in thread
From: Trevor Woerner @ 2017-06-24 1:55 UTC (permalink / raw)
To: Khem Raj; +Cc: yocto@yoctoproject.org
On Fri 2017-06-23 @ 03:57:06 PM, Khem Raj wrote:
> On Fri, Jun 23, 2017 at 3:39 PM, Trevor Woerner <twoerner@gmail.com> wrote:
> > Adding that line, and adding meta-clang to bblayers.conf, did get the
> > llvm/clang compiler built and installed to recipe-sysroot-native. But
> > the moment it starts to build the package, it fails immediately with:
> >
> > | fatal error: 'string' file not found
> > | #include <string>
> > | ^~~~~~~~
> >
> > Did I miss a step? That seems like a pretty basic thing that would be
> > needed for using a toolchain. If feels like I'm missing something;
> > like I need to add something else to my local.conf. Thoughts?
> > Suggestions?
>
> which package is it ? it seems its missing proper -I paths.?
I'm investigating moving chromium to a newer version, specifically something
much closer to the current Linux stable (59.0.3071.109). My understanding is
the chromium developers use clang, which would explain why it's always so much
work to get it to compile with gcc. If I can get chromium to build with clang,
I think it would make future maintenance much easier. Switching from gyp to gn
was easy, but getting this newer version to build with gcc7 is a challenge.
When I go to the recipe-sysroot-native, I find clang in usr/bin. But from that
base location if I do a
$ find . -name "*string*" -print
I don't find any such include files. Should they not be installed to the
native sysroot alongside clang itself?
Here's one example of a failing compile:
| [16/25529] CXX obj/base/allocator/tcmalloc/sysinfo.o
| FAILED: obj/base/allocator/tcmalloc/sysinfo.o
| ../../../recipe-sysroot-native/usr/bin/clang++ -MMD -MF obj/base/allocator/tcmalloc/sysinfo.o.d -DNO_HEAP_CHECK -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DDISABLE_NACL -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=\"299960-1\" -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCOMPONENT_BUILD -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -DTCMALLOC_FOR_DEBUGALLOCATION -DTCMALLOC_DONT_REPLACE_SYSTEM_ALLOC -I../../base/allocator -I../../third_party/tcmalloc/chromium/src/base -I../../third_party/tcmalloc/chromium/src -I../.. -Igen -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -pipe -fcolor-diagnostics --target=arm-linux-gnueabihf -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a -pthread -mfpu=neon -O0 -fno-omit-frame-pointer -g2 --sysroot=../../build/linux/debian_jessie_arm-sysroot -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wall -Wno-unused-variable -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-reorder -Wno-unused-function -Wno-unused-local-typedefs -Wno-unused-private-field -Wno-sign-compare -Wno-unused-result -fvisibility-inlines-hidden -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=gnu++11 -fno-rtti -fno-exceptions -Wno-deprecated -c ../../third_party/tcmalloc/chromium/src/base/sysinfo.cc -o obj/base/allocator/tcmalloc/sysinfo.o
| In file included from ../../third_party/tcmalloc/chromium/src/base/sysinfo.cc:62:
| In file included from ../../third_party/tcmalloc/chromium/src/base/sysinfo.h:49:
| In file included from ../../third_party/tcmalloc/chromium/src/base/logging.h:49:
| ../../third_party/tcmalloc/chromium/src/base/commandlineflags.h:52:10: fatal error: 'string' file not found
| #include <string>
| ^~~~~~~~
| 1 error generated.
I can send you the non-working, partial recipe if you're interested too.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: using clang for one recipe
2017-06-24 1:55 ` Trevor Woerner
@ 2017-06-24 2:45 ` Khem Raj
0 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2017-06-24 2:45 UTC (permalink / raw)
To: Trevor Woerner; +Cc: yocto@yoctoproject.org
On Fri, Jun 23, 2017 at 6:55 PM, Trevor Woerner <twoerner@gmail.com> wrote:
> On Fri 2017-06-23 @ 03:57:06 PM, Khem Raj wrote:
>> On Fri, Jun 23, 2017 at 3:39 PM, Trevor Woerner <twoerner@gmail.com> wrote:
>> > Adding that line, and adding meta-clang to bblayers.conf, did get the
>> > llvm/clang compiler built and installed to recipe-sysroot-native. But
>> > the moment it starts to build the package, it fails immediately with:
>> >
>> > | fatal error: 'string' file not found
>> > | #include <string>
>> > | ^~~~~~~~
>> >
>> > Did I miss a step? That seems like a pretty basic thing that would be
>> > needed for using a toolchain. If feels like I'm missing something;
>> > like I need to add something else to my local.conf. Thoughts?
>> > Suggestions?
>>
>> which package is it ? it seems its missing proper -I paths.?
>
> I'm investigating moving chromium to a newer version, specifically something
> much closer to the current Linux stable (59.0.3071.109). My understanding is
> the chromium developers use clang, which would explain why it's always so much
> work to get it to compile with gcc. If I can get chromium to build with clang,
> I think it would make future maintenance much easier. Switching from gyp to gn
> was easy, but getting this newer version to build with gcc7 is a challenge.
>
> When I go to the recipe-sysroot-native, I find clang in usr/bin. But from that
> base location if I do a
>
> $ find . -name "*string*" -print
>
> I don't find any such include files. Should they not be installed to the
> native sysroot alongside clang itself?
>
> Here's one example of a failing compile:
>
> | [16/25529] CXX obj/base/allocator/tcmalloc/sysinfo.o
> | FAILED: obj/base/allocator/tcmalloc/sysinfo.o
> | ../../../recipe-sysroot-native/usr/bin/clang++ -MMD -MF obj/base/allocator/tcmalloc/sysinfo.o.d -DNO_HEAP_CHECK -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DDISABLE_NACL -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=\"299960-1\" -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCOMPONENT_BUILD -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -DTCMALLOC_FOR_DEBUGALLOCATION -DTCMALLOC_DONT_REPLACE_SYSTEM_ALLOC -I../../base/allocator -I../../third_party/tcmalloc/chromium/src/base -I../../third_party/tcmalloc/chromium/src -I../.. -Igen -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -pipe -fcolor-diagnostics --target=arm-linux-gnueabihf -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a -pthread -mfpu=neon -O0 -fno-omit-frame-pointer -g2 --sysroot=../../build/linux/debian_jessie_arm-sysroot -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wall -Wno-unused-variable -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-reorder -Wno-unused-function -Wno-unused-local-typedefs -Wno-unused-private-field -Wno-sign-compare -Wno-unused-result -fvisibility-inlines-hidden -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=gnu++11 -fno-rtti -fno-exceptions -Wno-deprecated -c ../../third_party/tcmalloc/chromium/src/base/sysinfo.cc -o obj/base/allocator/tcmalloc/sysinfo.o
> | In file included from ../../third_party/tcmalloc/chromium/src/base/sysinfo.cc:62:
> | In file included from ../../third_party/tcmalloc/chromium/src/base/sysinfo.h:49:
> | In file included from ../../third_party/tcmalloc/chromium/src/base/logging.h:49:
> | ../../third_party/tcmalloc/chromium/src/base/commandlineflags.h:52:10: fatal error: 'string' file not found
> | #include <string>
> | ^~~~~~~~
> | 1 error generated.
>
>
> I can send you the non-working, partial recipe if you're interested too.
Yes chrome uses clang primarily. I think whats missing it dependency
on C++ runtime. default is libstdc++ so I guess you have to add a
dependency on gcc-runtime
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-06-24 2:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-23 22:39 using clang for one recipe Trevor Woerner
2017-06-23 22:57 ` Khem Raj
2017-06-24 1:55 ` Trevor Woerner
2017-06-24 2:45 ` Khem Raj
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.