Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build-toolchain.sh: add D and OpenMP checks #61

Closed
wants to merge 1 commit into from

Conversation

vfazio
Copy link
Contributor

@vfazio vfazio commented Jun 25, 2023

Add checks for BR2_TOOLCHAIN_BUILDROOT_DLANG and BR2_GCC_ENABLE_OPENMP.

Correctly flagging these options allows external consumers to properly configure options that may depend on them[0].

[0] https://bugs.buildroot.org/show_bug.cgi?id=15634#c3

closes #60

Add checks for BR2_TOOLCHAIN_BUILDROOT_DLANG and BR2_GCC_ENABLE_OPENMP.

Correctly flagging these options allows external consumers to properly
configure options that may depend on them[0].

[0] https://bugs.buildroot.org/show_bug.cgi?id=15634#c3

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
@vfazio
Copy link
Contributor Author

vfazio commented Jun 25, 2023

I have done a test build against this commit and see that the flags are toggled correctly:

>>>   Rendering the SDK relocatable
PER_PACKAGE_DIR=/home/vfazio/development/toolchains-builder/build/output/per-package /home/vfazio/development/toolchains-builder/buildroot/support/scripts/fix-rpath host
PER_PACKAGE_DIR=/home/vfazio/development/toolchains-builder/build/output/per-package /home/vfazio/development/toolchains-builder/buildroot/support/scripts/fix-rpath staging
/usr/bin/install -m 755 /home/vfazio/development/toolchains-builder/buildroot/support/misc/relocate-sdk.sh /home/vfazio/development/toolchains-builder/build/x86-64-core-i7--glibc--stable-3.14/relocate-sdk.sh
mkdir -p /home/vfazio/development/toolchains-builder/build/x86-64-core-i7--glibc--stable-3.14/share/buildroot
echo /home/vfazio/development/toolchains-builder/build/x86-64-core-i7--glibc--stable-3.14 > /home/vfazio/development/toolchains-builder/build/x86-64-core-i7--glibc--stable-3.14/share/buildroot/sdk-location
>>>   Generating SDK tarball
tar czf "/home/vfazio/development/toolchains-builder/build/output/images/x86_64-buildroot-linux-gnu_sdk-buildroot.tar.gz" \
        --owner=0 --group=0 --numeric-owner \
        --transform='s#^home/vfazio/development/toolchains-builder/build/x86-64-core-i7--glibc--stable-3.14#x86_64-buildroot-linux-gnu_sdk-buildroot#' \
        -C / home/vfazio/development/toolchains-builder/build/x86-64-core-i7--glibc--stable-3.14
make: Leaving directory '/home/vfazio/development/toolchains-builder/buildroot'
INFO: making BR fragment to use the toolchain
INFO: toolchain fragment follows
BR2_x86_64=y
BR2_x86_corei7=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://toolchains.bootlin.com/downloads/output/toolchains/x86-64-core-i7/tarballs/x86-64-core-i7--glibc--stable-3.14.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_11=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_9=y
# BR2_TOOLCHAIN_EXTERNAL_LOCALE is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TOOLCHAIN_EXTERNAL_FORTRAN=y
# BR2_TOOLCHAIN_EXTERNAL_DLANG is not set
BR2_TOOLCHAIN_EXTERNAL_OPENMP=y
BR2_TOOLCHAIN_EXTERNAL_HAS_SSP=y
BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG=y
BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS=y
BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_NPTL=y
# BR2_TOOLCHAIN_EXTERNAL_INET_RPC is not set
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
INFO: toolchain fragment ends
INFO: Preparing the packaging of x86-64-core-i7--glibc--stable-3.14
Packaging the toolchain as x86-64-core-i7--glibc--stable-3.14.tar.bz2

@vfazio vfazio marked this pull request as ready for review June 25, 2023 14:22
@vfazio
Copy link
Contributor Author

vfazio commented Jun 26, 2023

@RomainNaour @tpetazzoni Just wanted to ping you two on this. I wasn't sure if i should submit the PR here or in https://gitlab.com/buildroot.org/toolchains-builder

else
echo "# BR2_TOOLCHAIN_EXTERNAL_DLANG is not set" >> ${fragment_file}
fi
if grep -q "BR2_GCC_ENABLE_OPENMP=y" ${configfile}; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be BR2_TOOLCHAIN_HAS_OPENMP ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So
if grep -q "BR2_TOOLCHAIN_BUILDROOT_FORTRAN=y" ${configfile}; then
should be
if grep -q "BR2_TOOLCHAIN_HAS_FORTRAN=y" ${configfile}; then

It seems this script is not really accurate...
Should we use BR2_TOOLCHAIN_BUILDROOT_xxx or BR2_TOOLCHAIN_HAS_xxx ?

Copy link
Contributor Author

@vfazio vfazio Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have to use BR2_TOOLCHAIN_BUILDROOT_*

we're looking for the features the buildroot tool chain is being built with so that we can then flag the EXTERNAL flags when it's used by subsequent BR project as an external toolchain. The BR2_TOOLCHAIN_BUILDROOT_xxx and BR2_TOOLCHAIN_EXTERNAL_xxx (depending on the BR config) drive the unified BR2_TOOLCHAIN_HAS_xxx option for packages to check to see if a feature is enabled

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right but my comment is about how the script is written, the generated config fragment should be the same with either BR2_TOOLCHAIN_BUILDROOT_xxx or BR2_TOOLCHAIN_HAS_xxx.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: BR2_TOOLCHAIN_EXTERNAL_DLANG will no longer be a problem since gcc 12 requires a D compiler on the host. Currently Buildroot doesn't check for DLANG on the host, so we can't enable the D backend on gcc 12.
See: https://gitlab.com/buildroot.org/buildroot/-/commit/6bd0cc0cb8a9a3016ca4970a21ebbf7f497dfe96

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -164,6 +164,16 @@ function make_br_fragment {
else
echo "# BR2_TOOLCHAIN_EXTERNAL_FORTRAN is not set" >> ${fragment_file}
fi
if grep -q "BR2_TOOLCHAIN_BUILDROOT_DLANG=y" ${configfile}; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BR2_TOOLCHAIN_HAS_DLANG ?

@RomainNaour
Copy link
Contributor

@RomainNaour @tpetazzoni Just wanted to ping you two on this. I wasn't sure if i should submit the PR here or in https://gitlab.com/buildroot.org/toolchains-builder

No, the gitlab repo is where the builds are done. PR are handled from this github repo.
See https://toolchains.bootlin.com

@tpetazzoni
Copy link
Contributor

Thanks, applied!

@tpetazzoni tpetazzoni closed this Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build-toolchain.sh doesn't flag all supported options
3 participants