From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 15C7EE0097C; Thu, 20 Sep 2018 06:35:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [192.162.216.181 listed in list.dnswl.org] * -0.0 SPF_HELO_PASS SPF: HELO matches SPF record * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] X-Greylist: delayed 165 seconds by postgrey-1.32 at yocto-www; Thu, 20 Sep 2018 06:35:03 PDT Received: from smtp-out4.electric.net (smtp-out4.electric.net [192.162.216.181]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 84EFBE006AF for ; Thu, 20 Sep 2018 06:35:03 -0700 (PDT) Received: from 1g2z44-00080J-UH by out4b.electric.net with emc1-ok (Exim 4.90_1) (envelope-from ) id 1g2z45-000876-UG; Thu, 20 Sep 2018 06:32:17 -0700 Received: by emcmailer; Thu, 20 Sep 2018 06:32:17 -0700 Received: from [176.58.6.8] (helo=VitalExchange.vitalograph.local) by out4b.electric.net with esmtps (TLSv1.2:AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1g2z44-00080J-UH; Thu, 20 Sep 2018 06:32:16 -0700 Received: from VITALEXCHANGE.vitalograph.local ([fe80::93c:7e0f:858e:c090]) by VitalExchange.vitalograph.local ([fe80::93c:7e0f:858e:c090%12]) with mapi id 14.03.0399.000; Thu, 20 Sep 2018 14:32:15 +0100 From: Evan O'Loughlin To: Bas Mevissen Thread-Topic: [yocto] Yocto SDK generated - unable to compile application Thread-Index: AQHUULkrB+PsRV1tME++SjwtRDDgE6T40b4AgAAXwvD///LzgIAAGSuvgAARigCAAB/e9g== Date: Thu, 20 Sep 2018 13:32:14 +0000 Message-ID: <2EE3E45FEAD8944697CC29BFE83DD70F289B93D6@VitalExchange.vitalograph.local> References: <2EE3E45FEAD8944697CC29BFE83DD70F289B91F2@VitalExchange.vitalograph.local> <2EE3E45FEAD8944697CC29BFE83DD70F289B92E6@VitalExchange.vitalograph.local>, <2EE3E45FEAD8944697CC29BFE83DD70F289B931C@VitalExchange.vitalograph.local>, <47ce2f8e897e9f02943c4f9884e85488@basmevissen.nl> In-Reply-To: <47ce2f8e897e9f02943c4f9884e85488@basmevissen.nl> Accept-Language: en-IE, en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.245.60] MIME-Version: 1.0 X-Outbound-IP: 176.58.6.8 X-Env-From: evan.oloughlin@vitalograph.ie X-Proto: esmtps X-Revdns: X-HELO: VitalExchange.vitalograph.local X-TLS: TLSv1.2:AES256-GCM-SHA384:256 X-Authenticated_ID: X-PolicySMART: 14033467 X-Virus-Status: Scanned by VirusSMART (c) X-Virus-Status: Scanned by VirusSMART (s) Cc: "yocto@yoctoproject.org" Subject: Re: Yocto SDK generated - unable to compile application X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2018 13:35:06 -0000 Content-Language: en-IE Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable ________________________________________ From: Bas Mevissen [abuse@basmevissen.nl] Sent: 20 September 2018 13:23 To: Evan O'Loughlin Cc: yocto@yoctoproject.org Subject: Re: [yocto] Yocto SDK generated - unable to compile application On 2018-09-20 12:28, Evan O'Loughlin wrote: > ________________________________________ > From: Bas Mevissen [abuse@basmevissen.nl] > Sent: 20 September 2018 10:50 > To: Evan O'Loughlin > Cc: yocto@yoctoproject.org > Subject: Re: [yocto] Yocto SDK generated - unable to compile > application > > On 2018-09-20 11:40, Evan O'Loughlin wrote: >> -----Original Message----- >> From: Bas Mevissen [mailto:abuse@basmevissen.nl] >> Sent: 20 September 2018 10:12 >> To: Evan O'Loughlin >> Cc: yocto@yoctoproject.org >> Subject: Re: [yocto] Yocto SDK generated - unable to compile >> application >> >> On 2018-09-20 10:08, Evan O'Loughlin wrote: >>> Hello, >>> >>> I=92m having an issue when I try to use the SDK generated by my yocto >>> instance. >>> Currently I have yocto set-up to correctly build my image =96 this all >>> works well. >>> >>> I've built the SDK in the following ways: >>> * bitbake {image} =96c populate_sdk >>> * bitbake meta-toolchain-qt5 >>> * bitbake {image-sdk} using a separate recipe with the options: >>> - require {image}.bb >>> - IMAGE_FEATURES +=3D " dev-pkgs tools-sdk tools-debug >>> eclipse-debug debug-tweaks" >>> - IMAGE_INSTALL +=3D "kernel-devsrc" >>> - inherit populate_sdk populate_sdk_qt5 >>> >>> >>> When I try to use the generated SDKs I get the error below: >>> Simple helloworld app: >>> #include >>> #include >>> #include >>> #include >>> >>> int main (int argc, char** argv) >>> { >>> printf("Hello World\n"); >>> return 0; >>> } >>> >>> Compile error: >>> ${CC} helloworld.c >>> helloworld.c:4:19: fatal error: cstddef: No such file or directory >>> #include >>> ^ >>> compilation terminated >>> >>> >>> Have I missed a step in generating the SDK? >>> >>> >> >> No, your SDK looks fine. The solution is to just remove the line >> >> #include >> >> from your c sources or use the g++ compiler (called ${CXX) in >> Makefile) to compile the source. >> >>> Regards, >>> vitalEol > >> Hi Bas, >> >> I'm using the offending line in helloworld.c to highlight the issue >> I'm >> seeing. >> >> My main program is a Qt application where I see the same issue when >> trying to build in QtCreator. >> >> My issue relates to the fact that several include files are not >> readily available after 'sourcing' the environment setup. >> >> Do I need to adjust/include other recipes when building the SDK? >> > > I might be wrong, but this looks like you are using the gcc compiler > instead of the g++ one. See the second part of my answer. > > To check your environment, check in your sdk that the file cstddef > exists somewhere in /usr/include. Example from a Fedora Linux system: > > $ find /usr/include -name cstddef > /usr/include/c++/8/cstddef > > If I compile your example with "gcc" on that system, I get the same > error. With "g++", is is fine. It automatically find the cstddef header > file in the /usr/include/c++/8 directory. > > Hope this helps, > > (and please do not top post as that makes a mail thread unreadable) > > -- Bas. > > >> Regards, >> Evan >> > > Hi Bas, > > Apologies for top-posting previously. > > using ${CC}, ${CPP} or ${CXX} all show the same error relating to not > finding the required include > > cstddef is available in the cross-compiler toolchain: > $ find . -name cstddef > ./sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/cstddef > ./sysroots/armv7ahf-neon-linux-gnueabi/usr/include/boost/compatibility/cp= p_c_headers/cstddef > That looks fine. > and is also available on my system: > $ find /usr/include -name cstddef > /usr/include/c++/5/cstddef > /usr/include/c++/4.7/cstddef > /usr/include/c++/4.8/cstddef > > > ${CC} --version && ${CPP} --version && ${CXX} --version > arm-linux-gnueabihf-gcc (Linaro GCC 6.2-2016.11) 6.2.1 20161016 > 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. > > arm-linux-gnueabihf-gcc (Linaro GCC 6.2-2016.11) 6.2.1 20161016 > 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. > > arm-linux-gnueabihf-g++ (Linaro GCC 6.2-2016.11) 6.2.1 20161016 > 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. > I tried with an Freescale i.MX6 SDK for Sumo and that compiled fine with ${CXX}. It is a bit of guessing now. Maybe somewhat more information might help: What version of Yocto are you using? What layers are included? What machine? Are you sure this is the cross compiler belonging to the SDK? Did you maybe move the SDK install location and not adapt the environment file? Please check this with "echo ${SDKTARGETSYSROOT}" and "echo ${CXX}" > > Regards, > Evan I'm using the yocto setup from Ti related to their processor-sdk v04.03.00.= 05 (http://software-dl.ti.com/processor-sdk-linux/esd/AM335X/04_03_00_05/in= dex_FDS.html & http://software-dl.ti.com/processor-sdk-linux/esd/docs/04_03= _00_05/linux/Overview.html#processor-sdk-linux-building-the-sdk) Build Configuration: BB_VERSION =3D "1.32.0" BUILD_SYS =3D "x86_64-linux" NATIVELSBSTRING =3D "Ubuntu-16.04" TARGET_SYS =3D "arm-linux-gnueabi" MACHINE =3D "XYZ-PROD" DISTRO =3D "arago" DISTRO_VERSION =3D "2017.12" TUNE_FEATURES =3D "arm armv7a vfp thumb neon callconvention-hard" TARGET_FPU =3D "hard" meta-processor-sdk =3D "HEAD:92db4d8023d88ab59fab2953e7447ec0bd5a6db1" meta-ros =3D "HEAD:e2566402ab108a19634354a934788109422cf409" meta-arago-distro=20 meta-arago-extras =3D "HEAD:5b2a44b0c4d989133bc13d59398fd10375d351bb" meta-browser =3D "HEAD:26d50665e2f7223c5f4ad7481a8d2431e7cb55fb" meta-openamp =3D "HEAD:8a214032bfb7e8124bc1485c70c69f7d60abb819" meta-qt5 =3D "HEAD:2c9f0e4eb0e9097f6f872ec1e1d81768a8ab5f1b" meta-networking =20 meta-ruby =20 meta-python =20 meta-oe =20 meta-gnome =20 meta-multimedia =3D "HEAD:b40116cf457b88a2db14b86fda9627fb34d56ae6" meta-ti =3D "HEAD:3dc08477529b31ce887bb22a08201a843ded48f0" meta-linaro-toolchain=20 meta-optee =3D "HEAD:d73e794c7e7ebb1cc5bf495a52a72b26fb118250" meta =3D "HEAD:39fd8c129e2bff7f2f1649b7f6e036ccc50fd5d8" meta-XYZ =3D "sdk_04.03.00.05_dev:61ec90da8c798b357a343b92d1e41c403e0365d9= " workspace =3D ":" I'm using the same machine to build the image for my device & to generate t= he SDK. bitbake {image} -c populate_sdk results in arago-2017.12-toolchain-2017.12.= sh installer which i use to install to ~/tiToolchain_SDKv4 The environment file is as follows - all paths are correct & accessible : export SDKTARGETSYSROOT=3D/home/micheal/tiToolchain_SDKv4/sysroots/armv7ahf= -neon-linux-gnueabi export PATH=3D/home/micheal/tiToolchain_SDKv4/sysroots/x86_64-arago-linux/u= sr/bin:/home/micheal/tiToolchain_SDKv4/sysroots/x86_64-arago-linux/usr/sbin= :/home/micheal/tiToolchain_SDKv4/sysroots/x86_64-arago-linux/bin:/home/mich= eal/tiToolchain_SDKv4/sysroots/x86_64-arago-linux/sbin:/home/micheal/tiTool= chain_SDKv4/sysroots/x86_64-arago-linux/usr/bin/../x86_64-arago-linux/bin:/= home/micheal/tiToolchain_SDKv4/sysroots/x86_64-arago-linux/usr/bin/arm-linu= x-gnueabi:/home/micheal/tiToolchain_SDKv4/sysroots/x86_64-arago-linux/usr/b= in/arm-linux-uclibc:/home/micheal/tiToolchain_SDKv4/sysroots/x86_64-arago-l= inux/usr/bin/arm-linux-musl:$PATH export CCACHE_PATH=3D/home/micheal/tiToolchain_SDKv4/sysroots/x86_64-arago-= linux/usr/bin:/home/micheal/tiToolchain_SDKv4/sysroots/x86_64-arago-linux/u= sr/bin/../x86_64-arago-linux/bin:/home/micheal/tiToolchain_SDKv4/sysroots/x= 86_64-arago-linux/usr/bin/arm-linux-gnueabi:/home/micheal/tiToolchain_SDKv4= /sysroots/x86_64-arago-linux/usr/bin/arm-linux-uclibc:/home/micheal/tiToolc= hain_SDKv4/sysroots/x86_64-arago-linux/usr/bin/arm-linux-musl:$CCACHE_PATH export PKG_CONFIG_SYSROOT_DIR=3D$SDKTARGETSYSROOT export PKG_CONFIG_PATH=3D$SDKTARGETSYSROOT/usr/lib/pkgconfig:$SDKTARGETSYSR= OOT/usr/share/pkgconfig export CONFIG_SITE=3D/home/micheal/tiToolchain_SDKv4/site-config-armv7ahf-n= eon-linux-gnueabi export OECORE_NATIVE_SYSROOT=3D"/home/micheal/tiToolchain_SDKv4/sysroots/x8= 6_64-arago-linux" export OECORE_TARGET_SYSROOT=3D"$SDKTARGETSYSROOT" export OECORE_ACLOCAL_OPTS=3D"-I /home/micheal/tiToolchain_SDKv4/sysroots/x= 86_64-arago-linux/usr/share/aclocal" unset command_not_found_handle export CC=3D"arm-linux-gnueabihf-gcc -march=3Darmv7-a -marm -mfpu=3Dneon = -mfloat-abi=3Dhard --sysroot=3D$SDKTARGETSYSROOT" export CXX=3D"arm-linux-gnueabihf-g++ -march=3Darmv7-a -marm -mfpu=3Dneon = -mfloat-abi=3Dhard --sysroot=3D$SDKTARGETSYSROOT" export CPP=3D"arm-linux-gnueabihf-gcc -E -march=3Darmv7-a -marm -mfpu=3Dne= on -mfloat-abi=3Dhard --sysroot=3D$SDKTARGETSYSROOT" export AS=3D"arm-linux-gnueabihf-as " export LD=3D"arm-linux-gnueabihf-ld --sysroot=3D$SDKTARGETSYSROOT" export GDB=3Darm-linux-gnueabihf-gdb export STRIP=3Darm-linux-gnueabihf-strip export RANLIB=3Darm-linux-gnueabihf-ranlib export OBJCOPY=3Darm-linux-gnueabihf-objcopy export OBJDUMP=3Darm-linux-gnueabihf-objdump export AR=3Darm-linux-gnueabihf-ar export NM=3Darm-linux-gnueabihf-nm export M4=3Dm4 export TARGET_PREFIX=3Darm-linux-gnueabihf- export CONFIGURE_FLAGS=3D"--target=3Darm-linux-gnueabi --host=3Darm-linux-g= nueabi --build=3Dx86_64-linux --with-libtool-sysroot=3D$SDKTARGETSYSROOT" export CFLAGS=3D" -isystem/home/micheal/gcc-linaro-6.2.1-2016.11-x86_64_arm= -linux-gnueabihf/arm-linux-gnueabihf/include -O2 -pipe -g -feliminate-unus= ed-debug-types " export CXXFLAGS=3D" -isystem/home/micheal/gcc-linaro-6.2.1-2016.11-x86_64_a= rm-linux-gnueabihf/arm-linux-gnueabihf/include -O2 -pipe -g -feliminate-un= used-debug-types " export LDFLAGS=3D" -L/home/micheal/gcc-linaro-6.2.1-2016.11-x86_64_arm-linu= x-gnueabihf/arm-linux-gnueabihf/lib -Wl,-rpath-link,/home/micheal/gcc-linar= o-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/lib -Wl,-O1 = -Wl,--hash-style=3Dgnu" export CPPFLAGS=3D" -isystem/home/micheal/gcc-linaro-6.2.1-2016.11-x86_64_a= rm-linux-gnueabihf/arm-linux-gnueabihf/include " export KCFLAGS=3D"--sysroot=3D$SDKTARGETSYSROOT" export OECORE_DISTRO_VERSION=3D"2017.12" export OECORE_SDK_VERSION=3D"2017.12" export ARCH=3Darm export CROSS_COMPILE=3Darm-linux-gnueabihf- # Append environment subscripts if [ -d "$OECORE_TARGET_SYSROOT/environment-setup.d" ]; then for envfile in $OECORE_TARGET_SYSROOT/environment-setup.d/*.sh; do . $envfile done fi if [ -d "$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then for envfile in $OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do . $envfile done fi echo ${SDKTARGETSYSROOT} && echo ${CXX} /home/micheal/tiToolchain_SDKv4/sysroots/armv7ahf-neon-linux-gnueabi arm-linux-gnueabihf-g++ -march=3Darmv7-a -marm -mfpu=3Dneon -mfloat-abi=3Dh= ard --sysroot=3D/home/micheal/tiToolchain_SDKv4/sysroots/armv7ahf-neon-linu= x-gnueabi Thanks for your help so far with this; I'm stumped as to why the headers ar= e not found. Regards, Evan