build: add and use C_STANDARD and CXX_STANDARD in depends #22380

pull fanquake wants to merge 2 commits into bitcoin:master from fanquake:set_std_c_version_depends changing 12 files +27 −18
  1. fanquake commented at 6:40 am on July 1, 2021: member

    By explicitly setting a C standard version we avoid any potential for issues/differences in libraries that may come about due to C STD version, as well as avoid potentially being opted into newer code / features in libraries when compiler defaults change (i.e as of 11.0.0, Clang now defaults to gnu17 over gnu11).

    This should be a no-op for our release builds, because it’s just explicitly setting the default that is already being used. However this is relevant for anyone building depends with a newer compiler.

    I found one broken __STDC_VERSION__ check in the miniupnpc header.

    At the same time, add CXX_STANDARD for setting our C++ standard, and use that over setting -std=c++17 for cxx packages.

    Guix builds:

  2. fanquake added the label Build system on Jul 1, 2021
  3. DrahtBot commented at 8:12 am on July 1, 2021: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #22552 (build: Improve depends build system robustness by hebasto)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. hebasto commented at 12:12 pm on July 1, 2021: member

    Concept ACK.

    This should be a no-op for our release builds…

    Could be verified on by-package basis with #21995.

  5. fanquake force-pushed on Jul 1, 2021
  6. laanwj commented at 10:04 am on July 21, 2021: member

    Concept ACK.

    Would it make sense to define a global e.g. EXTRA_CFLAGS variable and use it for every package, instead of repeating this for every single one?

  7. tryphe commented at 10:39 pm on August 1, 2021: contributor
    Concept ACK
  8. Zero-1729 commented at 12:05 pm on August 21, 2021: contributor

    Concept ACK

    Would it make sense to define a global e.g. EXTRA_CFLAGS variable and use it for every package, instead of repeating this for every single one?

    Is there a reason for not going this route?

  9. fanquake force-pushed on Aug 31, 2021
  10. fanquake commented at 6:06 am on August 31, 2021: member

    I’ve reworked this, and based it on top of #22840.

    Would it make sense to define a global e.g. EXTRA_CFLAGS variable and use it for every package, instead of repeating this for every single one?

    I’ve added DEFAULT_C_STD and DEFAULT_CXX_STD variables to the depends makefile. Defaulting to c11 and c++17. This means the versions are set in one place, and can also be overriden if someone wants to experiment building with a different version. i.e gmake -C depends DEFAULT_CXX_STD=c++20.

  11. fanquake deleted a comment on Aug 31, 2021
  12. fanquake referenced this in commit 3af495d697 on Sep 2, 2021
  13. fanquake force-pushed on Sep 2, 2021
  14. sidhujag referenced this in commit 1dedbbcb8b on Sep 2, 2021
  15. fanquake commented at 2:28 am on September 2, 2021: member
    Rebased now that #22840 is in. Would be good to get feedback on the new approach.
  16. fanquake added the label DrahtBot Guix build requested on Sep 2, 2021
  17. theuni commented at 4:33 pm on September 3, 2021: member

    Concept ACK. Definitely better to be explicit.

    Nit: DEFAULT_FOO implies that it’s the fallback unless something specific was requested, which is not the case here as the value can be overridden. Would prefer to drop/replace the DEFAULT_ prefix.

  18. dongcarl commented at 6:08 pm on September 3, 2021: member

    Concept ACK!

    Wondering: instead of setting it for every package, could we do it in hosts/*.mk?

  19. DrahtBot commented at 2:07 pm on September 4, 2021: member

    Guix builds

    File commit dd097c42df7378c9d0114c04c82b3c38c18e13dc(master) commit be0afcbd0eee0b43bdcb185e5eaf1087071a45ac(master and this pull)
    SHA256SUMS.part bd03f15bef7e8032... 3c43ce4959a560af...
    *-aarch64-linux-gnu-debug.tar.gz 3c005baf7ecd04bd... da0f902679fd5c51...
    *-aarch64-linux-gnu.tar.gz bd6b69f9ab44abae... 474eca2f27bec458...
    *-arm-linux-gnueabihf-debug.tar.gz 5254853eda61abe2... 221d85dbdb4b8876...
    *-arm-linux-gnueabihf.tar.gz 4b97fb264f4072cf... 5275087d499bcfac...
    *-osx-unsigned.dmg 7ddf925af7278c7b... 4fc7a5c2b2ab81b1...
    *-osx-unsigned.tar.gz f2d5de5ae2884c4a... 2db8c62789888354...
    *-osx64.tar.gz be13ac7f3c95599c... 0b174c92c71011eb...
    *-powerpc64-linux-gnu-debug.tar.gz 56f83a417477190b... 51273002e428648f...
    *-powerpc64-linux-gnu.tar.gz e80ed9bf76c05090... 688050f7b4570d26...
    *-powerpc64le-linux-gnu-debug.tar.gz 30cda7a4d8bb29d2... 517e2f162b23d3ee...
    *-powerpc64le-linux-gnu.tar.gz 58ec7e9994ec39b9... 1f440165fe5426de...
    *-riscv64-linux-gnu-debug.tar.gz 55ed362a4de546be... e22cd95472418050...
    *-riscv64-linux-gnu.tar.gz 4579e3ab4d58c7bb... bec8dc730ab3ebc4...
    *-win-unsigned.tar.gz 00ab11872812ef6f... a8b3ceb993cc2ae7...
    *-win64-debug.zip 03bad628634cabea... 2f8aa503362dbc0b...
    *-win64-setup-unsigned.exe c8afc8e17eee28c0... 78d2f5ec1c3731e4...
    *-win64.zip 503d63813437f09e... 3ffdb852cf43e490...
    *-x86_64-linux-gnu-debug.tar.gz b0d3ae77ac844f42... 8320c373774f4f12...
    *-x86_64-linux-gnu.tar.gz c0529d7134912cdc... aba37dcb657a7bdc...
    *.tar.gz 16526c063ba0d708... 2763f5b94330c848...
    guix_build.log 60f25302213294cd... b6a003eb68bd5262...
    guix_build.log.diff 7914d08b35ff031a...
  20. DrahtBot removed the label DrahtBot Guix build requested on Sep 4, 2021
  21. practicalswift commented at 2:34 pm on September 4, 2021: contributor
    Concept ACK
  22. fanquake renamed this:
    build: Set -std=c11 for C dependencies in depends
    build: add and use C_STANDARD and CXX_STANDARD in depends
    on Sep 9, 2021
  23. fanquake force-pushed on Sep 9, 2021
  24. fanquake commented at 7:38 am on September 9, 2021: member

    Nit: DEFAULT_FOO implies that it’s the fallback unless something specific was requested, which is not the case here as the value can be overridden. Would prefer to drop/replace the DEFAULT_ prefix.

    Dropped the DEFAULT prefix.

    Wondering: instead of setting it for every package, could we do it in hosts/*.mk?

    Reworked to set both in hosts/*.mk. Is this what you had in mind?

  25. fanquake commented at 9:37 am on September 9, 2021: member

    Android build failure here looks unrelated, however the macOS one seems to be an issue. Doesn’t happen when building natively, only when cross-compiling qt:

     0Configuring qt...
     1Creating qmake...
     2make[1]: Entering directory '/tmp/cirrus-ci-build/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-07ec867c621/qtbase/qmake'
     3make[1]: Leaving directory '/tmp/cirrus-ci-build/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-07ec867c621/qtbase/qmake'
     4Info: creating super cache file /tmp/cirrus-ci-build/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-07ec867c621/.qmake.super
     5Info: creating cache file /tmp/cirrus-ci-build/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-07ec867c621/.qmake.cache
     6Info: creating stash file /tmp/cirrus-ci-build/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-07ec867c621/.qmake.stash
     7Command line: -bindir /tmp/cirrus-ci-build/depends/x86_64-apple-darwin18/native/bin -c++std c++1z -confirm-license -hostprefix /tmp/cirrus-ci-build/depends/x86_64-apple-darwin18/native -no-compile-examples -no-cups -no-egl -no-eglfs -no-freetype -no-gif -no-glib -no-icu -no-ico -no-iconv -no-kms -no-linuxfb -no-libjpeg -no-libproxy -no-libudev -no-mtdev -no-openssl -no-openvg -no-reduce-relocations -no-sctp -no-securetransport -no-sql-db2 -no-sql-ibase -no-sql-oci -no-sql-tds -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-system-proxies -no-use-gold-linker -nomake examples -nomake tests -nomake tools -opensource -pkg-config -prefix /tmp/cirrus-ci-build/depends/x86_64-apple-darwin18 -qt-libpng -qt-pcre -qt-harfbuzz -qt-zlib -static -v -no-feature-bearermanagement -no-feature-colordialog -no-feature-commandlineparser -no-feature-concurrent -no-feature-dial -no-feature-fontcombobox -no-feature-ftp -no-feature-http -no-feature-image_heuristic_mask -no-feature-keysequenceedit -no-feature-lcdnumber -no-feature-networkdiskcache -no-feature-networkproxy -no-feature-pdf -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sessionmanager -no-feature-socks5 -no-feature-sql -no-feature-sqlmodel -no-feature-statemachine -no-feature-syntaxhighlighter -no-feature-textbrowser -no-feature-textodfwriter -no-feature-topleveldomain -no-feature-udpsocket -no-feature-undocommand -no-feature-undogroup -no-feature-undostack -no-feature-undoview -no-feature-vnc -no-feature-wizard -no-feature-xml -release -silent -no-dbus -no-opengl -pch -no-feature-corewlan QMAKE_MACOSX_DEPLOYMENT_TARGET=10.14 -xplatform macx-clang-linux -device-option MAC_SDK_PATH=/tmp/cirrus-ci-build/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers -device-option MAC_SDK_VERSION=10.15.6 -device-option CROSS_COMPILE=x86_64-apple-darwin18- -device-option MAC_TARGET=x86_64-apple-darwin18 -device-option XCODE_VERSION=12.1
     8Project ERROR: Cannot run target compiler 'env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH -u LIBRARY_PATH /tmp/cirrus-ci-build/depends/x86_64-apple-darwin18/native/bin/clang++ --target=x86_64-apple-darwin18 -mmacosx-version-min=10.14 -B/tmp/cirrus-ci-build/depends/x86_64-apple-darwin18/native/bin -mlinker-version=609 -isysroot/tmp/cirrus-ci-build/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers -stdlib=libc++ -stdlib++-isystem/tmp/cirrus-ci-build/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers/usr/include/c++/v1 -Xclang -internal-externc-isystem/tmp/cirrus-ci-build/depends/x86_64-apple-darwin18/native/lib/clang/10.0.1/include -Xclang -internal-externc-isystem/tmp/cirrus-ci-build/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers/usr/include'. Output:
     9===================
    10clang version 10.0.1 
    11Target: x86_64-apple-darwin18
    12Thread model: posix
    13InstalledDir: /tmp/cirrus-ci-build/depends/x86_64-apple-darwin18/native/bin
    14 "/tmp/cirrus-ci-build/depends/x86_64-apple-darwin18/native/bin/clang" -cc1 -triple x86_64-apple-macosx10.14.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-rounding-math -masm-verbose -munwind-tables -target-sdk-version=10.15.6 -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 609 -v -resource-dir /tmp/cirrus-ci-build/depends/x86_64-apple-darwin18/native/lib/clang/10.0.1 -isysroot /tmp/cirrus-ci-build/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers -isysroot /tmp/cirrus-ci-build/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers -I /tmp/cirrus-ci-build/depends/x86_64-apple-darwin18/include -I /tmp/cirrus-ci-build/depends/x86_64-apple-darwin18/include -internal-isystem /tmp/cirrus-ci-build/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers/usr/include/c++/v1 -internal-isystem /tmp/cirrus-ci-build/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers/usr/local/include -internal-isystem /tmp/cirrus-ci-build/depends/x86_64-apple-darwin18/native/lib/clang/10.0.1/include -internal-externc-isystem /tmp/cirrus-ci-build/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers/usr/include -O2 -std=c11 -fdeprecated-macro -fdebug-compilation-dir /tmp/cirrus-ci-build/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-07ec867c621/qtbase/mkspecs/features -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fobjc-runtime=macosx-10.14.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -vectorize-loops -vectorize-slp -internal-externc-isystem/tmp/cirrus-ci-build/depends/x86_64-apple-darwin18/native/lib/clang/10.0.1/include -internal-externc-isystem/tmp/cirrus-ci-build/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers/usr/include -o /tmp/--eaf147.o -x c++ -
    15error: invalid argument '-std=c11' not allowed with 'C++'
    16===================
    17Maybe you forgot to setup the environment?
    

    Looks like clang is invoked, and our cflags are added -O2 -std=c11, however we end up with -x c++ on the end of our invocation when running some qt feature tests? Which results in Clang barfing. Will investigate.

    Additional verbose output:

     0g++ -c -o qlocale_unix.o   -std=c++11 -ffunction-sections -fdata-sections -O2 -g  -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/qmake -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/qmake/library -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/qmake/generators -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/qmake/generators/unix -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/qmake/generators/win32 -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/qmake/generators/mac -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/include -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/include/QtCore -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/include/QtCore/5.12.11 -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/include/QtCore/5.12.11/QtCore -I../src/corelib/global -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/mkspecs/linux-g++ -DQT_VERSION_STR=\"5.12.11\" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=12 -DQT_VERSION_PATCH=11 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH /home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/src/corelib/tools/qlocale_unix.cpp
     1g++ -c -o qlibraryinfo.o   -std=c++11 -ffunction-sections -fdata-sections -O2 -g  -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/qmake -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/qmake/library -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/qmake/generators -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/qmake/generators/unix -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/qmake/generators/win32 -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/qmake/generators/mac -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/include -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/include/QtCore -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/include/QtCore/5.12.11 -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/include/QtCore/5.12.11/QtCore -I../src/corelib/global -I/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/mkspecs/linux-g++ -DQT_VERSION_STR=\"5.12.11\" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=12 -DQT_VERSION_PATCH=11 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH -DQT_BUILD_QMAKE_BOOTSTRAP /home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/src/corelib/global/qlibraryinfo.cpp
     2g++ -o "../bin/qmake" main.o meta.o option.o project.o property.o ioutils.o proitems.o qmakebuiltins.o qmakeevaluator.o qmakeglobals.o qmakeparser.o qmakevfs.o pbuilder_pbx.o makefile.o makefiledeps.o metamakefile.o projectgenerator.o unixmake2.o unixmake.o mingw_make.o msbuild_objectmodel.o msvc_nmake.o msvc_objectmodel.o msvc_vcproj.o msvc_vcxproj.o winmakefile.o xmloutput.o qutfcodec.o qendian.o qglobal.o qlogging.o qmalloc.o qnumeric.o qoperatingsystemversion.o qrandom.o qabstractfileengine.o qbuffer.o qdatastream.o qdebug.o qdir.o qdiriterator.o qfile.o qfiledevice.o qfileinfo.o qfilesystemengine.o qfilesystementry.o qfsfileengine.o qfsfileengine_iterator.o qiodevice.o qsettings.o qtemporaryfile.o qtextstream.o qjsonarray.o qjson.o qjsondocument.o qjsonobject.o qjsonparser.o qjsonvalue.o qmetatype.o qsystemerror.o qvariant.o quuid.o qarraydata.o qbitarray.o qbytearray.o qbytearraylist.o qbytearraymatcher.o qcryptographichash.o qdatetime.o qhash.o qlinkedlist.o qlist.o qlocale.o qlocale_tools.o qmap.o qregexp.o qringbuffer.o qstringbuilder.o qstring_compat.o qstring.o qstringlist.o qversionnumber.o qvsnprintf.o qxmlstream.o qxmlutils.o qcore_unix.o qfilesystemengine_unix.o qfilesystemiterator_unix.o qfsfileengine_unix.o qlocale_unix.o  qlibraryinfo.o   -Wl,--gc-sections
     3make[1]: Leaving directory '/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/qmake'
     4Info: creating super cache file /home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/.qmake.super
     5Info: creating cache file /home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/.qmake.cache
     6Info: creating stash file /home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/.qmake.stash
     7Command line: -bindir /home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native/bin -c++std c++1z -confirm-license -hostprefix /home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native -no-compile-examples -no-cups -no-egl -no-eglfs -no-freetype -no-gif -no-glib -no-icu -no-ico -no-iconv -no-kms -no-linuxfb -no-libjpeg -no-libproxy -no-libudev -no-mtdev -no-openssl -no-openvg -no-reduce-relocations -no-sctp -no-securetransport -no-sql-db2 -no-sql-ibase -no-sql-oci -no-sql-tds -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-system-proxies -no-use-gold-linker -nomake examples -nomake tests -nomake tools -opensource -pkg-config -prefix /home/ubuntu/bitcoin/depends/x86_64-apple-darwin18 -qt-libpng -qt-pcre -qt-harfbuzz -qt-zlib -static -v -no-feature-bearermanagement -no-feature-colordialog -no-feature-commandlineparser -no-feature-concurrent -no-feature-dial -no-feature-fontcombobox -no-feature-ftp -no-feature-http -no-feature-image_heuristic_mask -no-feature-keysequenceedit -no-feature-lcdnumber -no-feature-networkdiskcache -no-feature-networkproxy -no-feature-pdf -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sessionmanager -no-feature-socks5 -no-feature-sql -no-feature-sqlmodel -no-feature-statemachine -no-feature-syntaxhighlighter -no-feature-textbrowser -no-feature-textodfwriter -no-feature-topleveldomain -no-feature-udpsocket -no-feature-undocommand -no-feature-undogroup -no-feature-undostack -no-feature-undoview -no-feature-vnc -no-feature-wizard -no-feature-xml -debug -optimized-tools -no-dbus -no-opengl -pch -no-feature-corewlan QMAKE_MACOSX_DEPLOYMENT_TARGET=10.14 -xplatform macx-clang-linux -device-option MAC_SDK_PATH=/home/ubuntu/bitcoin/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers -device-option MAC_SDK_VERSION=10.15.6 -device-option CROSS_COMPILE=x86_64-apple-darwin18- -device-option MAC_TARGET=x86_64-apple-darwin18 -device-option XCODE_VERSION=12.1
     8Project ERROR: Cannot run target compiler 'env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH -u LIBRARY_PATH /home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native/bin/clang++ --target=x86_64-apple-darwin18 -mmacosx-version-min=10.14 -B/home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native/bin -mlinker-version=609 -isysroot/home/ubuntu/bitcoin/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers -stdlib=libc++ -stdlib++-isystem/home/ubuntu/bitcoin/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers/usr/include/c++/v1 -Xclang -internal-externc-isystem/home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native/lib/clang/10.0.1/include -Xclang -internal-externc-isystem/home/ubuntu/bitcoin/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers/usr/include'. Output:
     9===================
    10clang version 10.0.1 
    11Target: x86_64-apple-darwin18
    12Thread model: posix
    13InstalledDir: /home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native/bin
    14clang: warning: no such sysroot directory: '/home/ubuntu/bitcoin/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers' [-Wmissing-sysroot]
    15 "/home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native/bin/clang" -cc1 -triple x86_64-apple-macosx10.14.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-rounding-math -masm-verbose -munwind-tables -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 609 -v -resource-dir /home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native/lib/clang/10.0.1 -isysroot /home/ubuntu/bitcoin/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers -isysroot /home/ubuntu/bitcoin/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers -I /home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/include -I /home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/include -internal-isystem /home/ubuntu/bitcoin/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers/usr/include/c++/v1 -internal-isystem /home/ubuntu/bitcoin/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers/usr/local/include -internal-isystem /home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native/lib/clang/10.0.1/include -internal-externc-isystem /home/ubuntu/bitcoin/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers/usr/include -O1 -std=c11 -fdeprecated-macro -fdebug-compilation-dir /home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/qtbase/mkspecs/features -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fobjc-runtime=macosx-10.14.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -internal-externc-isystem/home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native/lib/clang/10.0.1/include -internal-externc-isystem/home/ubuntu/bitcoin/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers/usr/include -o /tmp/--b15c28.o -x c++ -
    16error: invalid argument '-std=c11' not allowed with 'C++'
    17===================
    18Maybe you forgot to setup the environment?
    19make: *** [funcs.mk:282: /home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/qt/5.12.11-5bb48e1827c/./.stamp_configured] Error 3
    20make: Leaving directory '/home/ubuntu/bitcoin/depends'
    
  26. dongcarl commented at 2:36 pm on October 12, 2021: member

    Does this mean that qmake tests CXX by invoking it with CFLAGS?

    image

  27. DrahtBot added the label Needs rebase on Nov 14, 2021
  28. fanquake force-pushed on Nov 14, 2021
  29. fanquake force-pushed on Nov 14, 2021
  30. fanquake commented at 4:46 am on November 14, 2021: member
    Rebased on master, and added a potential fix for the macOS cross-compile issue. Which is to just not append QMAKE_CFLAGS to QMAKE_CXXFLAGS in the macOS configuration.
  31. DrahtBot removed the label Needs rebase on Nov 14, 2021
  32. fanquake force-pushed on Nov 16, 2021
  33. fanquake force-pushed on Nov 16, 2021
  34. fanquake commented at 2:14 am on November 16, 2021: member
    Updated both commits to document the new variables in the depends README.
  35. dongcarl commented at 7:16 pm on November 16, 2021: member

    Looking clean! A few points of discussion:

    1. Wondering if it’d make sense to somehow export the CXX_STANDARD in config.site
    2. Wondering if we should be putting -std flags in CFLAGS or CC, for any other flag I would argue for CFLAGS, but -std seems quite fundamental, and if I understand correctly prior versions of autoconf would put -std flags into CC when requested: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/C-Compiler.html
  36. DrahtBot added the label Needs rebase on Jan 7, 2022
  37. fanquake force-pushed on Jan 10, 2022
  38. fanquake commented at 0:53 am on January 10, 2022: member

    Wondering if it’d make sense to somehow export the CXX_STANDARD in config.site

    Potentially. Although if we did export it, and then passed it through to, for example, ax_cxx_compile_stdcxx, that script doesn’t support detecting C++20 or later.

    Wondering if we should be putting -std flags in CFLAGS or CC

    I don’t have a particular opinion here.

  39. DrahtBot removed the label Needs rebase on Jan 10, 2022
  40. DrahtBot added the label Needs rebase on Feb 3, 2022
  41. fanquake force-pushed on Feb 4, 2022
  42. fanquake commented at 1:46 am on February 4, 2022: member
    Rebased. @theuni @dongcarl do either of you have any additional thoughts here? Will add new Guix hashes to PR description.
  43. fanquake removed the label Needs rebase on Feb 4, 2022
  44. DrahtBot added the label Needs rebase on Feb 14, 2022
  45. fanquake force-pushed on Feb 14, 2022
  46. DrahtBot removed the label Needs rebase on Feb 14, 2022
  47. fanquake added this to the "Blockers" column in a project

  48. fanquake force-pushed on Apr 9, 2022
  49. in depends/README.md:100 in ab58ac49ff outdated
     95@@ -96,6 +96,8 @@ The following can be set when running make: `make FOO=bar`
     96 - `BASE_CACHE`: Built packages will be placed here
     97 - `SDK_PATH`: Path where SDKs can be found (used by macOS)
     98 - `FALLBACK_DOWNLOAD_PATH`: If a source file can't be fetched, try here before giving up
     99+- `C_STANDARD`: Set the C standard version used. Defaults to `C11`.
    100+- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `C++17`.
    


    dongcarl commented at 3:33 pm on April 20, 2022:
    0- `C_STANDARD`: Set the C standard version used. Defaults to `c11`.
    1- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `c++17`.
    

    fanquake commented at 4:17 pm on April 20, 2022:
    Fixed.
  50. dongcarl commented at 3:52 pm on April 20, 2022: member
    I think we added a few more hosts between my last review and this one. I’m also wondering if there’s a good way to have this in hosts/default.mk somehow to stop worrying about new hosts, though hosts/default.mk does give me the scaries whenever I think about changing it.
  51. fanquake force-pushed on Apr 20, 2022
  52. DrahtBot added the label Needs rebase on Jun 14, 2022
  53. fanquake force-pushed on Jun 14, 2022
  54. fanquake removed this from the "Blockers" column in a project

  55. DrahtBot removed the label Needs rebase on Jun 14, 2022
  56. build: add and use C_STANDARD in depends 7e7b3e42fa
  57. build: add and use CXX_STANDARD in depends f7595f1354
  58. fanquake force-pushed on Jun 16, 2022
  59. fanquake commented at 4:29 pm on June 16, 2022: member

    Updated this for the addition of new HOSTS and the LTO merge.

    I’m also wondering if there’s a good way to have this in hosts/default.mk somehow to stop worrying about new hosts,

    Now that we’ve also got a “global” LTO option, it could make sense to consolidate that, plus these two options into default.mk. Maybe we could just adjust C and CXX flags when using either of the 3 options? Not sure if we want to do that here, or a follow up after further discussion.

  60. dongcarl commented at 5:28 pm on June 16, 2022: member

    @fanquake

    Not sure if we want to do that here, or a follow up after further discussion.

    I don’t mind at all what route we take. Let me know what you’d like to do!

  61. fanquake commented at 5:51 pm on June 16, 2022: member
    @dongcarl I’d probably rather consolidate in a follow up, after more discussion, if you’re happy to review here.
  62. dongcarl commented at 6:26 pm on June 16, 2022: member

    Code Review ACK f7595f1354f4618436fdab232000dc152bff315a

    Quite a simple change, good consistency improvement can be seen in the non-depends/hosts file diffs

  63. laanwj commented at 9:42 pm on June 16, 2022: member
    Code review ACK f7595f1354f4618436fdab232000dc152bff315a Changes look correct to me. I have run a succesful build, but was unable to conclude from the logging whether every package passes the correct flag to gcc/g++ (as a lot do not show the verbose build commands).
  64. laanwj merged this on Jun 16, 2022
  65. laanwj closed this on Jun 16, 2022

  66. fanquake deleted the branch on Jun 16, 2022
  67. sidhujag referenced this in commit c20081a0e2 on Jun 17, 2022
  68. fanquake referenced this in commit 8bcdcbb0d1 on Jun 17, 2022
  69. fanquake referenced this in commit f862f4a74e on Jun 17, 2022
  70. fanquake referenced this in commit 34869114a7 on Jun 21, 2022
  71. sidhujag referenced this in commit 8766b174f6 on Jun 21, 2022
  72. DrahtBot locked this on Jun 16, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me