Message ID | 20230706212335.1893675-6-denis@denix.org |
---|---|
State | Accepted |
Delegated to: | Ryan Eatmon |
Headers | show |
Series | Rework secondary toolchain for K3R5 | expand |
Hi Denys, This is probably not about this new patch series for the r5f toolchain. I am facing issues with the internal toolchain for A72 I was trying out u-boot and linux builds with these new internal toolchains and everything works fine EXCEPT for u-boot-a72 build: I get this error : "aarch64-oe-linux-ld.bfd: cannot find -lgcc: No such file or directory" I narrowed down the error to incorrect Ldir being parsed in the u-boot Makefile here [1] which expects absolute path for the print-libgcc-file-name. The build with the external toolchain works coz that prints the absolute path while the yocto internal toolchain is returning just the filename: ./bin/aarch64-none-linux-gnu-gcc -print-libgcc-file-name #Prints full path to libgcc.a file ./linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-gcc -print-libgcc-file-name #Prints just "libgcc.a". The dirname for this returns "." [1]: https://git.ti.com/cgit/ti-u-boot/ti-u-boot/tree/Makefile?h=ti-u-boot-2023.04#n895 As it stands, I am unable to build u-boot with the internal toolchain. Either something needs to be fixed in the toolchain itself or I am missing some flag / Env variable? Thanks, Aniket On 07/07/23 02:53, Denys Dmytriyenko wrote: > From: Denys Dmytriyenko<denys@konsulko.com> > > No longer needed w/o external toolchain - use defaults from OE-Core. > > Also remove extra code that was trying to unify internal and external > toolchains structures in meta-toolchain-arago. > > Signed-off-by: Denys Dmytriyenko<denys@konsulko.com> > --- > meta-arago-distro/conf/distro/arago.conf | 10 ---- > .../conf/distro/include/toolchain-gcc.inc | 41 -------------- > .../distro/include/toolchain-internal.inc | 4 -- > .../recipes-core/meta/meta-toolchain-arago.bb | 54 +++++-------------- > 4 files changed, 14 insertions(+), 95 deletions(-) > delete mode 100644 meta-arago-distro/conf/distro/include/toolchain-gcc.inc > delete mode 100644 meta-arago-distro/conf/distro/include/toolchain-internal.inc > > diff --git a/meta-arago-distro/conf/distro/arago.conf b/meta-arago-distro/conf/distro/arago.conf > index ceb74b6e..f03c82bf 100644 > --- a/meta-arago-distro/conf/distro/arago.conf > +++ b/meta-arago-distro/conf/distro/arago.conf > @@ -152,16 +152,6 @@ ARAGO_SYSTEST_ENABLE ?= "0" > ARAGO_KERNEL_SUFFIX:append ="${@oe.utils.conditional("ARAGO_SYSTEST_ENABLE", "1", "-systest", "", d)}" > IMAGE_FSTYPES:remove ="${@['','ubi ubifs'][d.getVar('ARAGO_SYSTEST_ENABLE') == '1']}" > > -# Toolchain should be selected by setting TOOLCHAIN_BRAND in local.conf > -# Set some sane defaults, in case someone forgets to set them in local.conf > -TC_SANE_DEFAULT ?= "arm" > -TOOLCHAIN_TYPE ?= "internal" > -TOOLCHAIN_TYPE:omapl138 = "internal" > -TOOLCHAIN_BRAND ?="${@[d.getVar('TC_SANE_DEFAULT'),'gcc'][d.getVar('TOOLCHAIN_TYPE') == > 'internal']}" > - > -require conf/distro/include/toolchain-${TOOLCHAIN_BRAND}.inc > -require conf/distro/include/toolchain-${TOOLCHAIN_TYPE}.inc > - > # Enable basic stack and buffer overflow protections > #TARGET_CPPFLAGS += "-fstack-protector -D_FORTIFY_SOURCE=1" > #TARGET_CPPFLAGS += "-fstack-protector" > diff --git a/meta-arago-distro/conf/distro/include/toolchain-gcc.inc b/meta-arago-distro/conf/distro/include/toolchain-gcc.inc > deleted file mode 100644 > index 1c059a6f..00000000 > --- a/meta-arago-distro/conf/distro/include/toolchain-gcc.inc > +++ /dev/null > @@ -1,41 +0,0 @@ > -# Select internal gcc toolchain to be built from sources > -TCMODE = "default" > -TCLIBC = "glibc" > - > -LIBCEXTENSION ="${@['', '-gnu'][(d.getVar('ABIEXTENSION') or '') != '']}" > - > -# Match some of the external vars > -TOOLCHAIN_SYS := "${TARGET_SYS}" > -TOOLCHAIN_PREFIX := "${TARGET_PREFIX}" > - > -PREFERRED_PROVIDER_gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}" > -PREFERRED_PROVIDER_binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}" > -PREFERRED_PROVIDER_gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}" > - > -# Set Cross and SDK toolchain preferences > -SDKGCCVERSION ?= "11%" > -SDKBINUVERSION ?= "2.38%" > -SDKGLIBCVERSION ?= "2.35%" > - > -PREFERRED_VERSION_gcc-crosssdk-${SDK_SYS} ?= "${SDKGCCVERSION}" > -PREFERRED_VERSION_gcc-crosssdk-initial-${SDK_SYS} ?= "${SDKGCCVERSION}" > -PREFERRED_VERSION_binutils-crosssdk-${SDK_SYS} ?= "${SDKBINUVERSION}" > - > -PREFERRED_VERSION_nativesdk-gcc-runtime ?= "${SDKGCCVERSION}" > -PREFERRED_VERSION_nativesdk-libgcc ?= "${SDKGCCVERSION}" > -PREFERRED_VERSION_nativesdk-libgcc-initial ?= "${SDKGCCVERSION}" > -PREFERRED_VERSION_nativesdk-glibc ?= "${SDKGLIBCVERSION}" > -PREFERRED_VERSION_nativesdk-glibc-locale ?= "${SDKGLIBCVERSION}" > -PREFERRED_VERSION_nativesdk-glibc-initial ?= "${SDKGLIBCVERSION}" > - > -# Set target toolchain preferences to match Cross/SDK by default > -# Can be overwritten globally, if needed > -GCCVERSION ?= "11%" > -BINUVERSION ?= "2.38%" > -GLIBCVERSION ?= "2.35%" > - > -PREFERRED_VERSION_gcc ?= "${GCCVERSION}" > -PREFERRED_VERSION_binutils ?= "${BINUVERSION}" > -PREFERRED_VERSION_glibc ?= "${GLIBCVERSION}" > -PREFERRED_VERSION_glibc-locale ?= "${GLIBCVERSION}" > -PREFERRED_VERSION_glibc-initial ?= "${GLIBCVERSION}" > diff --git a/meta-arago-distro/conf/distro/include/toolchain-internal.inc b/meta-arago-distro/conf/distro/include/toolchain-internal.inc > deleted file mode 100644 > index cbc3b53d..00000000 > --- a/meta-arago-distro/conf/distro/include/toolchain-internal.inc > +++ /dev/null > @@ -1,4 +0,0 @@ > -# No special handling is required for locating the internal toolchain, just re-use existing vars > -TOOLCHAIN_PATH ?= "${STAGING_BINDIR_TOOLCHAIN}" > -TOOLCHAIN_SYSPATH ?= "${TOOLCHAIN_PATH}/${TARGET_SYS}" > -EXTERNAL_TOOLCHAIN = "${TOOLCHAIN_PATH}" > diff --git a/meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb b/meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb > index 5c1c3ad0..8bff9abb 100644 > --- a/meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb > +++ b/meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb > @@ -33,8 +33,8 @@ toolchain_create_sdk_env_script () { > echo 'fi' >> $script > echo 'export SDK_SYS=${SDK_SYS}' >> $script > echo 'export REAL_MULTIMACH_TARGET_SYS=${REAL_MULTIMACH_TARGET_SYS}' >> $script > - echo 'export TOOLCHAIN_SYS=${TOOLCHAIN_SYS}' >> $script > - echo 'export TOOLCHAIN_PREFIX=$TOOLCHAIN_SYS-' >> $script > + echo 'export TARGET_SYS=${TARGET_SYS}' >> $script > + echo 'export TARGET_PREFIX=$TARGET_SYS-' >> $script > echo 'export SDK_PATH_NATIVE=$SDK_PATH/sysroots/$SDK_SYS' >> $script > echo 'export SDK_PATH_TARGET=$SDK_PATH/sysroots/$REAL_MULTIMACH_TARGET_SYS' >> $script > echo 'export PATH=$SDK_PATH_NATIVE${bindir_nativesdk}:$SDK_PATH_NATIVE${bindir_nativesdk}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}:$PATH' >> $script > @@ -43,18 +43,18 @@ toolchain_create_sdk_env_script () { > echo 'export PKG_CONFIG_PATH=$SDK_PATH_TARGET${libdir}/pkgconfig:$SDK_PATH_TARGET${datadir}/pkgconfig' >> $script > echo 'export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1' >> $script > echo 'export CONFIG_SITE=$SDK_PATH/site-config-$REAL_MULTIMACH_TARGET_SYS' >> $script > - printf 'export CC="\x24{TOOLCHAIN_PREFIX}gcc --sysroot=$SDK_PATH_TARGET"\n' >> $script > - printf 'export CXX="\x24{TOOLCHAIN_PREFIX}g++ --sysroot=$SDK_PATH_TARGET"\n' >> $script > - printf 'export GDB=\x24{TOOLCHAIN_PREFIX}gdb\n' >> $script > - printf 'export CPP="\x24{TOOLCHAIN_PREFIX}gcc -E --sysroot=$SDK_PATH_TARGET"\n' >> $script > - printf 'export LD="\x24{TOOLCHAIN_PREFIX}ld --sysroot=$SDK_PATH_TARGET"\n' >> $script > - printf 'export NM=\x24{TOOLCHAIN_PREFIX}nm\n' >> $script > - printf 'export AS=\x24{TOOLCHAIN_PREFIX}as\n' >> $script > - printf 'export AR=\x24{TOOLCHAIN_PREFIX}ar\n' >> $script > - printf 'export RANLIB=\x24{TOOLCHAIN_PREFIX}ranlib\n' >> $script > - printf 'export OBJCOPY=\x24{TOOLCHAIN_PREFIX}objcopy\n' >> $script > - printf 'export OBJDUMP=\x24{TOOLCHAIN_PREFIX}objdump\n' >> $script > - printf 'export STRIP=\x24{TOOLCHAIN_PREFIX}strip\n' >> $script > + printf 'export CC="\x24{TARGET_PREFIX}gcc --sysroot=$SDK_PATH_TARGET"\n' >> $script > + printf 'export CXX="\x24{TARGET_PREFIX}g++ --sysroot=$SDK_PATH_TARGET"\n' >> $script > + printf 'export GDB=\x24{TARGET_PREFIX}gdb\n' >> $script > + printf 'export CPP="\x24{TARGET_PREFIX}gcc -E --sysroot=$SDK_PATH_TARGET"\n' >> $script > + printf 'export LD="\x24{TARGET_PREFIX}ld --sysroot=$SDK_PATH_TARGET"\n' >> $script > + printf 'export NM=\x24{TARGET_PREFIX}nm\n' >> $script > + printf 'export AS=\x24{TARGET_PREFIX}as\n' >> $script > + printf 'export AR=\x24{TARGET_PREFIX}ar\n' >> $script > + printf 'export RANLIB=\x24{TARGET_PREFIX}ranlib\n' >> $script > + printf 'export OBJCOPY=\x24{TARGET_PREFIX}objcopy\n' >> $script > + printf 'export OBJDUMP=\x24{TARGET_PREFIX}objdump\n' >> $script > + printf 'export STRIP=\x24{TARGET_PREFIX}strip\n' >> $script > echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux --with-libtool-sysroot=$SDK_PATH_TARGET"' >> $script > echo 'export CPPFLAGS="${TARGET_CC_ARCH} --sysroot=$SDK_PATH_TARGET"' >> $script > echo 'export CFLAGS="$CPPFLAGS"' >> $script > @@ -97,32 +97,6 @@ arago_sdk_fixup () { > done > > cleanup_toolchain_packages > - > - # Do some extra setup work due to new structure > - mkdir -p "${SDK_OUTPUT}/${SDKPATHNATIVE}${prefix_nativesdk}/lib/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}" > - if [ "${TOOLCHAIN_TYPE}" = "internal" ]; then > - lexec="${SDK_OUTPUT}/${SDKPATHNATIVE}${prefix_nativesdk}/libexec/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}/gcc/${TOOLCHAIN_SYS}" > - else > - lexec="${SDK_OUTPUT}/${SDKPATHNATIVE}${prefix_nativesdk}/libexec/gcc/${TOOLCHAIN_SYS}" > - fi > - tcv=`ls -1 $lexec|head -1` > - [ -e ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/lib/$tcv ] || ln -s . ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/lib/$tcv > - [ -e ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/lib/$tcv ] || ln -s . ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/lib/$tcv > - [ -e ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/lib/${TOOLCHAIN_SYS} ] || ln -s . ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/lib/${TOOLCHAIN_SYS} > - [ -e ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/lib/${TOOLCHAIN_SYS} ] || ln -s . ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/lib/${TOOLCHAIN_SYS} > - tcpath="${SDK_OUTPUT}/${SDKPATHNATIVE}${prefix_nativesdk}/${TOOLCHAIN_SYS}" > - mkdir -p $tcpath > - ( cd $tcpath; \ > - ln -s ${SDKTARGETSYSROOT}/include include; \ > - if [ "${TOOLCHAIN_BRAND}" != "arago" ]; then \ > - mkdir -p libc; \ > - cd libc; \ > - fi; \ > - mkdir -p usr; \ > - ln -s ${SDKTARGETSYSROOT}/lib lib; \ > - ln -s ${SDKTARGETSYSROOT}/usr/lib usr/lib; \ > - ln -s ${SDKTARGETSYSROOT}/usr/include usr/include; \ > - ) > } > > fakeroot create_sdk_files() {
On Fri, Aug 11, 2023 at 05:00:30PM +0530, Aniket Limaye wrote: > Hi Denys, > > This is probably not about this new patch series for the r5f > toolchain. I am facing issues with the internal toolchain for A72 > > I was trying out u-boot and linux builds with these new internal > toolchains and everything works fine EXCEPT for u-boot-a72 build: > > I get this error : "aarch64-oe-linux-ld.bfd: cannot find -lgcc: No > such file or directory" > > I narrowed down the error to incorrect Ldir being parsed in the > u-boot Makefile here [1] which expects absolute path for the > print-libgcc-file-name. > > The build with the external toolchain works coz that prints the > absolute path while the yocto internal toolchain is returning just > the filename: ./bin/aarch64-none-linux-gnu-gcc > -print-libgcc-file-name #Prints full path to libgcc.a file > > ./linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-gcc > -print-libgcc-file-name #Prints just "libgcc.a". The dirname for > this returns "." > > [1]: https://git.ti.com/cgit/ti-u-boot/ti-u-boot/tree/Makefile?h=ti-u-boot-2023.04#n895 > > As it stands, I am unable to build u-boot with the internal > toolchain. Either something needs to be fixed in the toolchain > itself or I am missing some flag / Env variable? Aniket, You need to pass the correct --sysroot to gcc. And the environment-setup-aarch64-oe-linux script properly sets CC variable already with the correct --sysroot of the installed linux-devkit: $ echo $CC aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=/tmp/sdk/sysroots/aarch64-oe-linux $ $CC -print-libgcc-file-name /tmp/sdk/sysroots/aarch64-oe-linux/usr/lib/aarch64-oe-linux/11.4.0/libgcc.a You can pass this to the U-boot Makefile: $ make CC="$CC" <any other vars> <target> As a reference, u-boot recipe passes at least CROSS_COMPILE, CC and HOSTCC.
On 15/08/23 00:55, Denys Dmytriyenko wrote: > On Fri, Aug 11, 2023 at 05:00:30PM +0530, Aniket Limaye wrote: >> Hi Denys, >> >> This is probably not about this new patch series for the r5f >> toolchain. I am facing issues with the internal toolchain for A72 >> >> I was trying out u-boot and linux builds with these new internal >> toolchains and everything works fine EXCEPT for u-boot-a72 build: >> >> I get this error : "aarch64-oe-linux-ld.bfd: cannot find -lgcc: No >> such file or directory" >> >> I narrowed down the error to incorrect Ldir being parsed in the >> u-boot Makefile here [1] which expects absolute path for the >> print-libgcc-file-name. >> >> The build with the external toolchain works coz that prints the >> absolute path while the yocto internal toolchain is returning just >> the filename: ./bin/aarch64-none-linux-gnu-gcc >> -print-libgcc-file-name #Prints full path to libgcc.a file >> >> ./linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-gcc >> -print-libgcc-file-name #Prints just "libgcc.a". The dirname for >> this returns "." >> >> [1]: https://git.ti.com/cgit/ti-u-boot/ti-u-boot/tree/Makefile?h=ti-u-boot-2023.04#n895 >> >> As it stands, I am unable to build u-boot with the internal >> toolchain. Either something needs to be fixed in the toolchain >> itself or I am missing some flag / Env variable? > Aniket, > > You need to pass the correct --sysroot to gcc. > > And the environment-setup-aarch64-oe-linux script properly sets CC variable > already with the correct --sysroot of the installed linux-devkit: > > $ echo $CC > aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=/tmp/sdk/sysroots/aarch64-oe-linux > > $ $CC -print-libgcc-file-name > /tmp/sdk/sysroots/aarch64-oe-linux/usr/lib/aarch64-oe-linux/11.4.0/libgcc.a > > You can pass this to the U-boot Makefile: > > $ make CC="$CC" <any other vars> <target> > > As a reference, u-boot recipe passes at least CROSS_COMPILE, CC and HOSTCC. > Explicitly setting CC, with the correct sysroot, when calling make u-boot-a72 worked for me. Thanks for the clarification! Ryan, we can merge this series now
diff --git a/meta-arago-distro/conf/distro/arago.conf b/meta-arago-distro/conf/distro/arago.conf index ceb74b6e..f03c82bf 100644 --- a/meta-arago-distro/conf/distro/arago.conf +++ b/meta-arago-distro/conf/distro/arago.conf @@ -152,16 +152,6 @@ ARAGO_SYSTEST_ENABLE ?= "0" ARAGO_KERNEL_SUFFIX:append = "${@oe.utils.conditional("ARAGO_SYSTEST_ENABLE", "1", "-systest", "", d)}" IMAGE_FSTYPES:remove = "${@['','ubi ubifs'][d.getVar('ARAGO_SYSTEST_ENABLE') == '1']}" -# Toolchain should be selected by setting TOOLCHAIN_BRAND in local.conf -# Set some sane defaults, in case someone forgets to set them in local.conf -TC_SANE_DEFAULT ?= "arm" -TOOLCHAIN_TYPE ?= "internal" -TOOLCHAIN_TYPE:omapl138 = "internal" -TOOLCHAIN_BRAND ?= "${@[d.getVar('TC_SANE_DEFAULT'),'gcc'][d.getVar('TOOLCHAIN_TYPE') == 'internal']}" - -require conf/distro/include/toolchain-${TOOLCHAIN_BRAND}.inc -require conf/distro/include/toolchain-${TOOLCHAIN_TYPE}.inc - # Enable basic stack and buffer overflow protections #TARGET_CPPFLAGS += "-fstack-protector -D_FORTIFY_SOURCE=1" #TARGET_CPPFLAGS += "-fstack-protector" diff --git a/meta-arago-distro/conf/distro/include/toolchain-gcc.inc b/meta-arago-distro/conf/distro/include/toolchain-gcc.inc deleted file mode 100644 index 1c059a6f..00000000 --- a/meta-arago-distro/conf/distro/include/toolchain-gcc.inc +++ /dev/null @@ -1,41 +0,0 @@ -# Select internal gcc toolchain to be built from sources -TCMODE = "default" -TCLIBC = "glibc" - -LIBCEXTENSION = "${@['', '-gnu'][(d.getVar('ABIEXTENSION') or '') != '']}" - -# Match some of the external vars -TOOLCHAIN_SYS := "${TARGET_SYS}" -TOOLCHAIN_PREFIX := "${TARGET_PREFIX}" - -PREFERRED_PROVIDER_gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}" -PREFERRED_PROVIDER_binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}" -PREFERRED_PROVIDER_gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}" - -# Set Cross and SDK toolchain preferences -SDKGCCVERSION ?= "11%" -SDKBINUVERSION ?= "2.38%" -SDKGLIBCVERSION ?= "2.35%" - -PREFERRED_VERSION_gcc-crosssdk-${SDK_SYS} ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_gcc-crosssdk-initial-${SDK_SYS} ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_binutils-crosssdk-${SDK_SYS} ?= "${SDKBINUVERSION}" - -PREFERRED_VERSION_nativesdk-gcc-runtime ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_nativesdk-libgcc ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_nativesdk-libgcc-initial ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_nativesdk-glibc ?= "${SDKGLIBCVERSION}" -PREFERRED_VERSION_nativesdk-glibc-locale ?= "${SDKGLIBCVERSION}" -PREFERRED_VERSION_nativesdk-glibc-initial ?= "${SDKGLIBCVERSION}" - -# Set target toolchain preferences to match Cross/SDK by default -# Can be overwritten globally, if needed -GCCVERSION ?= "11%" -BINUVERSION ?= "2.38%" -GLIBCVERSION ?= "2.35%" - -PREFERRED_VERSION_gcc ?= "${GCCVERSION}" -PREFERRED_VERSION_binutils ?= "${BINUVERSION}" -PREFERRED_VERSION_glibc ?= "${GLIBCVERSION}" -PREFERRED_VERSION_glibc-locale ?= "${GLIBCVERSION}" -PREFERRED_VERSION_glibc-initial ?= "${GLIBCVERSION}" diff --git a/meta-arago-distro/conf/distro/include/toolchain-internal.inc b/meta-arago-distro/conf/distro/include/toolchain-internal.inc deleted file mode 100644 index cbc3b53d..00000000 --- a/meta-arago-distro/conf/distro/include/toolchain-internal.inc +++ /dev/null @@ -1,4 +0,0 @@ -# No special handling is required for locating the internal toolchain, just re-use existing vars -TOOLCHAIN_PATH ?= "${STAGING_BINDIR_TOOLCHAIN}" -TOOLCHAIN_SYSPATH ?= "${TOOLCHAIN_PATH}/${TARGET_SYS}" -EXTERNAL_TOOLCHAIN = "${TOOLCHAIN_PATH}" diff --git a/meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb b/meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb index 5c1c3ad0..8bff9abb 100644 --- a/meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb +++ b/meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb @@ -33,8 +33,8 @@ toolchain_create_sdk_env_script () { echo 'fi' >> $script echo 'export SDK_SYS=${SDK_SYS}' >> $script echo 'export REAL_MULTIMACH_TARGET_SYS=${REAL_MULTIMACH_TARGET_SYS}' >> $script - echo 'export TOOLCHAIN_SYS=${TOOLCHAIN_SYS}' >> $script - echo 'export TOOLCHAIN_PREFIX=$TOOLCHAIN_SYS-' >> $script + echo 'export TARGET_SYS=${TARGET_SYS}' >> $script + echo 'export TARGET_PREFIX=$TARGET_SYS-' >> $script echo 'export SDK_PATH_NATIVE=$SDK_PATH/sysroots/$SDK_SYS' >> $script echo 'export SDK_PATH_TARGET=$SDK_PATH/sysroots/$REAL_MULTIMACH_TARGET_SYS' >> $script echo 'export PATH=$SDK_PATH_NATIVE${bindir_nativesdk}:$SDK_PATH_NATIVE${bindir_nativesdk}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}:$PATH' >> $script @@ -43,18 +43,18 @@ toolchain_create_sdk_env_script () { echo 'export PKG_CONFIG_PATH=$SDK_PATH_TARGET${libdir}/pkgconfig:$SDK_PATH_TARGET${datadir}/pkgconfig' >> $script echo 'export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1' >> $script echo 'export CONFIG_SITE=$SDK_PATH/site-config-$REAL_MULTIMACH_TARGET_SYS' >> $script - printf 'export CC="\x24{TOOLCHAIN_PREFIX}gcc --sysroot=$SDK_PATH_TARGET"\n' >> $script - printf 'export CXX="\x24{TOOLCHAIN_PREFIX}g++ --sysroot=$SDK_PATH_TARGET"\n' >> $script - printf 'export GDB=\x24{TOOLCHAIN_PREFIX}gdb\n' >> $script - printf 'export CPP="\x24{TOOLCHAIN_PREFIX}gcc -E --sysroot=$SDK_PATH_TARGET"\n' >> $script - printf 'export LD="\x24{TOOLCHAIN_PREFIX}ld --sysroot=$SDK_PATH_TARGET"\n' >> $script - printf 'export NM=\x24{TOOLCHAIN_PREFIX}nm\n' >> $script - printf 'export AS=\x24{TOOLCHAIN_PREFIX}as\n' >> $script - printf 'export AR=\x24{TOOLCHAIN_PREFIX}ar\n' >> $script - printf 'export RANLIB=\x24{TOOLCHAIN_PREFIX}ranlib\n' >> $script - printf 'export OBJCOPY=\x24{TOOLCHAIN_PREFIX}objcopy\n' >> $script - printf 'export OBJDUMP=\x24{TOOLCHAIN_PREFIX}objdump\n' >> $script - printf 'export STRIP=\x24{TOOLCHAIN_PREFIX}strip\n' >> $script + printf 'export CC="\x24{TARGET_PREFIX}gcc --sysroot=$SDK_PATH_TARGET"\n' >> $script + printf 'export CXX="\x24{TARGET_PREFIX}g++ --sysroot=$SDK_PATH_TARGET"\n' >> $script + printf 'export GDB=\x24{TARGET_PREFIX}gdb\n' >> $script + printf 'export CPP="\x24{TARGET_PREFIX}gcc -E --sysroot=$SDK_PATH_TARGET"\n' >> $script + printf 'export LD="\x24{TARGET_PREFIX}ld --sysroot=$SDK_PATH_TARGET"\n' >> $script + printf 'export NM=\x24{TARGET_PREFIX}nm\n' >> $script + printf 'export AS=\x24{TARGET_PREFIX}as\n' >> $script + printf 'export AR=\x24{TARGET_PREFIX}ar\n' >> $script + printf 'export RANLIB=\x24{TARGET_PREFIX}ranlib\n' >> $script + printf 'export OBJCOPY=\x24{TARGET_PREFIX}objcopy\n' >> $script + printf 'export OBJDUMP=\x24{TARGET_PREFIX}objdump\n' >> $script + printf 'export STRIP=\x24{TARGET_PREFIX}strip\n' >> $script echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux --with-libtool-sysroot=$SDK_PATH_TARGET"' >> $script echo 'export CPPFLAGS="${TARGET_CC_ARCH} --sysroot=$SDK_PATH_TARGET"' >> $script echo 'export CFLAGS="$CPPFLAGS"' >> $script @@ -97,32 +97,6 @@ arago_sdk_fixup () { done cleanup_toolchain_packages - - # Do some extra setup work due to new structure - mkdir -p "${SDK_OUTPUT}/${SDKPATHNATIVE}${prefix_nativesdk}/lib/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}" - if [ "${TOOLCHAIN_TYPE}" = "internal" ]; then - lexec="${SDK_OUTPUT}/${SDKPATHNATIVE}${prefix_nativesdk}/libexec/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}/gcc/${TOOLCHAIN_SYS}" - else - lexec="${SDK_OUTPUT}/${SDKPATHNATIVE}${prefix_nativesdk}/libexec/gcc/${TOOLCHAIN_SYS}" - fi - tcv=`ls -1 $lexec|head -1` - [ -e ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/lib/$tcv ] || ln -s . ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/lib/$tcv - [ -e ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/lib/$tcv ] || ln -s . ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/lib/$tcv - [ -e ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/lib/${TOOLCHAIN_SYS} ] || ln -s . ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/lib/${TOOLCHAIN_SYS} - [ -e ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/lib/${TOOLCHAIN_SYS} ] || ln -s . ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/lib/${TOOLCHAIN_SYS} - tcpath="${SDK_OUTPUT}/${SDKPATHNATIVE}${prefix_nativesdk}/${TOOLCHAIN_SYS}" - mkdir -p $tcpath - ( cd $tcpath; \ - ln -s ${SDKTARGETSYSROOT}/include include; \ - if [ "${TOOLCHAIN_BRAND}" != "arago" ]; then \ - mkdir -p libc; \ - cd libc; \ - fi; \ - mkdir -p usr; \ - ln -s ${SDKTARGETSYSROOT}/lib lib; \ - ln -s ${SDKTARGETSYSROOT}/usr/lib usr/lib; \ - ln -s ${SDKTARGETSYSROOT}/usr/include usr/include; \ - ) } fakeroot create_sdk_files() {