Page MenuHomePhabricator

[CMAKE] Fix missing linker wrap for fcntl64
ClosedPublic

Authored by Fabien on Apr 30 2020, 07:59.

Details

Summary

D5881 moved the LFS definition but not the linker wrapping function
associated. This breaks the Linux Gitian build due to symbol check
failure.
This diff moves the linker flag so it applies to libraries as well.
After this diff there is no longer any global or directory level flag
set after including the libraries. A comment is added to help preventing
further issues.
Note that the config is included prior the LFS addition to benefit from
the definition, otherwise it is added blindly.

Depends on D5901.

Test Plan

Run the Linux Gitian builds.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cmake_fix_symbol_check
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 10498
Build 18814: Default Diff Build & Tests
Build 18813: arc lint + arc unit

Event Timeline

Fabien planned changes to this revision.Apr 30 2020, 08:00

Pending gitian build

Snippet of first build failure:

[08:01:17] :	 [Step 1/1] (Reading database ... 75%
[08:01:17] :	 [Step 1/1] (Reading database ... 80%
[08:01:17] :	 [Step 1/1] (Reading database ... 85%
[08:01:17] :	 [Step 1/1] (Reading database ... 90%
[08:01:17] :	 [Step 1/1] (Reading database ... 95%
[08:01:17] :	 [Step 1/1] (Reading database ... 100%
[08:01:17] :	 [Step 1/1] (Reading database ... 17694 files and directories currently installed.)
[08:01:17] :	 [Step 1/1] Removing rsyslog (8.1901.0-1) ...
[08:01:18] :	 [Step 1/1] invoke-rc.d: could not determine current runlevel
[08:01:18] :	 [Step 1/1] Stopping enhanced syslogd: rsyslogd already stopped.
[08:01:18] :	 [Step 1/1] (Reading database ... 
[08:01:18] :	 [Step 1/1] (Reading database ... 5%
[08:01:18] :	 [Step 1/1] (Reading database ... 10%
[08:01:18] :	 [Step 1/1] (Reading database ... 15%
[08:01:18] :	 [Step 1/1] (Reading database ... 20%
[08:01:18] :	 [Step 1/1] (Reading database ... 25%
[08:01:18] :	 [Step 1/1] (Reading database ... 30%
[08:01:18] :	 [Step 1/1] (Reading database ... 35%
[08:01:18] :	 [Step 1/1] (Reading database ... 40%
[08:01:18] :	 [Step 1/1] (Reading database ... 45%
[08:01:18] :	 [Step 1/1] (Reading database ... 50%
[08:01:18] :	 [Step 1/1] (Reading database ... 55%
[08:01:18] :	 [Step 1/1] (Reading database ... 60%
[08:01:18] :	 [Step 1/1] (Reading database ... 65%
[08:01:18] :	 [Step 1/1] (Reading database ... 70%
[08:01:18] :	 [Step 1/1] (Reading database ... 75%
[08:01:18] :	 [Step 1/1] (Reading database ... 80%
[08:01:18] :	 [Step 1/1] (Reading database ... 85%
[08:01:18] :	 [Step 1/1] (Reading database ... 90%
[08:01:18] :	 [Step 1/1] (Reading database ... 95%
[08:01:18] :	 [Step 1/1] (Reading database ... 100%
[08:01:18] :	 [Step 1/1] (Reading database ... 17636 files and directories currently installed.)
[08:01:18] :	 [Step 1/1] Purging configuration files for rsyslog (8.1901.0-1) ...
[08:01:18] :	 [Step 1/1] Processing triggers for systemd (241-7~deb10u3) ...
[08:01:18] :	 [Step 1/1] Adding 'local diversion of /sbin/initctl to /sbin/initctl.distrib'
[08:01:18] :	 [Step 1/1] Adding 'local diversion of /usr/bin/ischroot to /usr/bin/ischroot.distrib'
[08:01:18]W:	 [Step 1/1] dpkg-divert: warning: diverting file '/usr/bin/ischroot' from an Essential package with rename is dangerous, use --no-rename
[08:01:18] :	 [Step 1/1] Adding 'local diversion of /usr/sbin/policy-rc.d to /usr/sbin/policy-rc.d.distrib'
[08:01:18] :	 [Step 1/1] Starting target
[08:01:19] :	 [Step 1/1] Checking if target is up
[08:01:19] :	 [Step 1/1] Preparing build environment
[08:01:37] :	 [Step 1/1] Adding multiarch support (log in var/install.log)
[08:01:37] :	 [Step 1/1] Updating apt-get repository (log in var/install.log)
[08:01:42] :	 [Step 1/1] Installing additional packages (log in var/install.log)
[08:02:37] :	 [Step 1/1] Upgrading system, may take a while (log in var/install.log)
[08:02:40] :	 [Step 1/1] Creating package manifest
[08:02:45] :	 [Step 1/1] Creating build script (var/build-script)
[08:02:47] :	 [Step 1/1] Running build script (log in var/build.log)
[08:07:28]W:	 [Step 1/1] ./bin/gbuild:23:in `system!': failed to run on-target setarch x86_64 bash -x < var/build-script > var/build.log 2>&1 (RuntimeError)
[08:07:28]W:	 [Step 1/1] 	from ./bin/gbuild:169:in `build_one_configuration'
[08:07:28]W:	 [Step 1/1] 	from ./bin/gbuild:320:in `block (2 levels) in <main>'
[08:07:28]W:	 [Step 1/1] 	from ./bin/gbuild:315:in `each'
[08:07:28]W:	 [Step 1/1] 	from ./bin/gbuild:315:in `block in <main>'
[08:07:28]W:	 [Step 1/1] 	from ./bin/gbuild:313:in `each'
[08:07:28]W:	 [Step 1/1] 	from ./bin/gbuild:313:in `<main>'
[08:07:28]W:	 [Step 1/1] ++ move_log
[08:07:28]W:	 [Step 1/1] ++ mv var/install.log /home/teamcity/buildAgent/work/c4a5708f2bae7929/gitian-results/
[08:07:28]W:	 [Step 1/1] ++ mv var/build.log /home/teamcity/buildAgent/work/c4a5708f2bae7929/gitian-results/
[08:07:28]W:	 [Step 1/1] Process exited with code 1
[08:07:28]E:	 [Step 1/1] Process exited with code 1 (Step: Command Line)
Fabien planned changes to this revision.Apr 30 2020, 09:50
Fabien edited the summary of this revision. (Show Details)

Snippet of first build failure:

[09:58:52] :	 [Step 1/2] [406/454] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/coin_selection.cpp.o
[09:58:53] :	 [Step 1/2] [407/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qrc_bitcoin.cpp.o
[09:58:53] :	 [Step 1/2] [408/454] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/__/test/setup_common.cpp.o
[09:58:53] :	 [Step 1/2] [409/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/clientmodel.cpp.o
[09:58:53] :	 [Step 1/2] [410/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/bitcoin.cpp.o
[09:58:54] :	 [Step 1/2] [411/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/optionsdialog.cpp.o
[09:58:54] :	 [Step 1/2] [412/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/bitcoingui.cpp.o
[09:58:54] :	 [Step 1/2] [413/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/optionsmodel.cpp.o
[09:58:56] :	 [Step 1/2] [414/454] Linking CXX executable src/bench/bitcoin-bench
[09:58:56] :	 [Step 1/2] [415/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/guiutil.cpp.o
[09:58:56] :	 [Step 1/2] [416/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/trafficgraphwidget.cpp.o
[09:58:56] :	 [Step 1/2] [417/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/coincontroltreewidget.cpp.o
[09:58:57] :	 [Step 1/2] [418/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/addressbookpage.cpp.o
[09:58:57] :	 [Step 1/2] [419/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/peertablemodel.cpp.o
[09:58:58] :	 [Step 1/2] [420/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/editaddressdialog.cpp.o
[09:58:58] :	 [Step 1/2] [421/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/utilitydialog.cpp.o
[09:58:58] :	 [Step 1/2] [422/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/splashscreen.cpp.o
[09:59:00] :	 [Step 1/2] [423/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/askpassphrasedialog.cpp.o
[09:59:01] :	 [Step 1/2] [424/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qrc_bitcoin_locale.cpp.o
[09:59:02] :	 [Step 1/2] [425/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/openuridialog.cpp.o
[09:59:03] :	 [Step 1/2] [426/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/overviewpage.cpp.o
[09:59:04] :	 [Step 1/2] [427/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/transactiondescdialog.cpp.o
[09:59:04] :	 [Step 1/2] [428/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/addresstablemodel.cpp.o
[09:59:04] :	 [Step 1/2] [429/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/receiverequestdialog.cpp.o
[09:59:04] :	 [Step 1/2] [430/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/transactionfilterproxy.cpp.o
[09:59:05] :	 [Step 1/2] [431/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/rpcconsole.cpp.o
[09:59:06] :	 [Step 1/2] [432/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/sendcoinsentry.cpp.o
[09:59:06] :	 [Step 1/2] [433/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/recentrequeststablemodel.cpp.o
[09:59:06] :	 [Step 1/2] [434/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/coincontroldialog.cpp.o
[09:59:07] :	 [Step 1/2] [435/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/receivecoinsdialog.cpp.o
[09:59:08] :	 [Step 1/2] [436/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/paymentserver.cpp.o
[09:59:10] :	 [Step 1/2] [437/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/transactionrecord.cpp.o
[09:59:11] :	 [Step 1/2] [438/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletframe.cpp.o
[09:59:11] :	 [Step 1/2] [439/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/paymentrequestplus.cpp.o
[09:59:11] :	 [Step 1/2] FAILED: src/qt/CMakeFiles/bitcoin-qt-base.dir/paymentrequestplus.cpp.o 
[09:59:11] :	 [Step 1/2] /usr/bin/ccache /usr/bin/c++  -DBOOST_AC_USE_STD_ATOMIC -DBOOST_SP_USE_STD_ATOMIC -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Isrc/qt/bitcoin-qt-base_autogen/include -I../src/. -Isrc -I../src/univalue/include -Isrc/crypto/.. -I../src/secp256k1/include -I../src/leveldb/include -isystem /usr/include/miniupnpc -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtDBus -g -O2 -fPIC -fvisibility=hidden   -fstack-reuse=none -fstack-protector-all -Wstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wformat-security -Wcast-align -Wunused-parameter -Wmissing-braces -Wshadow -Wredundant-decls -Wno-unused-parameter -Wno-implicit-fallthrough -pthread -fPIC -std=gnu++14 -MD -MT src/qt/CMakeFiles/bitcoin-qt-base.dir/paymentrequestplus.cpp.o -MF src/qt/CMakeFiles/bitcoin-qt-base.dir/paymentrequestplus.cpp.o.d -o src/qt/CMakeFiles/bitcoin-qt-base.dir/paymentrequestplus.cpp.o -c ../src/qt/paymentrequestplus.cpp
[09:59:11] :	 [Step 1/2] ../src/qt/paymentrequestplus.cpp: In member function 'bool PaymentRequestPlus::getMerchant(X509_STORE*, QString&) const':
[09:59:11] :	 [Step 1/2] ../src/qt/paymentrequestplus.cpp:179:20: error: aggregate 'EVP_MD_CTX _ctx' has incomplete type and cannot be defined
[09:59:11] :	 [Step 1/2]          EVP_MD_CTX _ctx;
[09:59:11] :	 [Step 1/2]                     ^~~~
[09:59:11] :	 [Step 1/2] [440/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/transactionview.cpp.o
[09:59:11] :	 [Step 1/2] [441/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletcontroller.cpp.o
[09:59:11] :	 [Step 1/2] [442/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/signverifymessagedialog.cpp.o
[09:59:11] :	 [Step 1/2] [443/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/sendcoinsdialog.cpp.o
[09:59:11] :	 [Step 1/2] [444/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/transactiondesc.cpp.o
[09:59:11] :	 [Step 1/2] [445/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletmodeltransaction.cpp.o
[09:59:12] :	 [Step 1/2] [446/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletview.cpp.o
[09:59:12] :	 [Step 1/2] [447/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/transactiontablemodel.cpp.o
[09:59:14] :	 [Step 1/2] [448/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletmodel.cpp.o
[09:59:14] :	 [Step 1/2] [449/454] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/bitcoin-qt-base_autogen/mocs_compilation.cpp.o
[09:59:14] :	 [Step 1/2] ninja: build stopped: subcommand failed.
[09:59:14] :	 [Step 1/2] *** Output of /tmp/sanitizer_logs/*.log.* ***
[09:59:14]W:	 [Step 1/2] ++ print_sanitizers_log
[09:59:14]W:	 [Step 1/2] ++ for log in "${SAN_LOG_DIR}"/*.log.*
[09:59:14]W:	 [Step 1/2] ++ echo '*** Output of /tmp/sanitizer_logs/*.log.* ***'
[09:59:14]W:	 [Step 1/2] ++ cat '/tmp/sanitizer_logs/*.log.*'
[09:59:14]W:	 [Step 1/2] cat: '/tmp/sanitizer_logs/*.log.*': No such file or directory
[09:59:15]W:	 [Step 1/2] cp: cannot stat '/work/ibd/debug.log': No such file or directory
[09:59:20]W:	 [Step 1/2] Process exited with code 1
[09:59:20]E:	 [Step 1/2] Process exited with code 1 (Step: Command Line)
Fabien planned changes to this revision.Apr 30 2020, 10:47
Fabien requested review of this revision.Apr 30 2020, 11:27
This revision is now accepted and ready to land.Apr 30 2020, 11:30
This revision was automatically updated to reflect the committed changes.