Re: armv7 targeting context: www/qt5-webengine poudriere build used "/usr/bin/c++ -B/usr/local/bin . . ." and failed : 'cmath' file not found

From: Mark Millard <marklmi_at_yahoo.com>
Date: Mon, 30 May 2022 22:47:45 UTC
On 2022-May-30, at 14:22, Mark Millard <marklmi@yahoo.com> wrote:

> On 2022-May-30, at 13:05, Mark Millard <marklmi@yahoo.com> wrote:
> 
>> [This is a separate problem from another I sent to the
>> list earlier.]
>> 
>> My attempted bulk -a -c targeting armv7 (on a aarch64 machine
>> that can execute armv7 code) failed.
>> 
>> Note, from the log file:
> 
> Hmm. I should have noticed that the below was nested inside
> a "Installing mesa-dri-21.3.8...". So possibly not a direct
> use context for llvm13.
> 
>> [CA72_UFS] |   |   `-- Installing llvm13-13.0.1_2...
>> [CA72_UFS] |   |   | `-- Installing libedit-3.1.20210910,1...
>> [CA72_UFS] |   |   | `-- Extracting libedit-3.1.20210910,1: .......... done
>> [CA72_UFS] |   |   | `-- Installing lua53-5.3.6...
>> [CA72_UFS] |   |   | `-- Extracting lua53-5.3.6: .......... done
>> [CA72_UFS] |   |   | `-- Installing perl5-5.32.1_1...
>> [CA72_UFS] |   |   | `-- Extracting perl5-5.32.1_1: .......... done
>> [CA72_UFS] |   |   `-- Extracting llvm13-13.0.1_2: .......... done
>> 
>> So I'd expect llvm13's clang/clang++ and such to be in use.
>> 
>> But it ends up using /usr/bin/c++ as a path to a c++ but also using
>> -B/usr/local/bin in the same command. The combination ends up not
>> finding things like <cmath> --and that in turn leads to build
>> failure. (I show the first example but others happen before the
>> build  fully stops.)
> 
> Yet . . .
> 
> /usr/bin/c++ -B/usr/local/bin . . .
> 
> still seems odd and the error message reported did
> happen.
> 
>> From the logfile:
>> 
>> [  0% 12/21219] CXX obj/base/third_party/double_conversion/double_conversion/bignum-dtoa.o
>> FAILED: obj/base/third_party/double_conversion/double_conversion/bignum-dtoa.o 
>> /usr/bin/c++ -B/usr/local/bin -MMD -MF obj/base/third_party/double_conversion/double_conversion/bignum-dtoa.o.d -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../../../qtwebengine-everywhere-src-5.15.2/src/3rdparty/chromium -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-unknown-attributes -Wno-unknown-pragmas -Wno-unknown-warning-option -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants --target=arm-linux-gnueabihf -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a -no-canonical-prefixes -mfpu=vfpv3-d16 -marm -Wall -Wextra -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-unused-const-variable -Wno-unused-function -Wno-parentheses-equality -Wno-tautological-compare -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++14 -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -c ../../../../qtwebengine-everywhere-src-5.15.2/src/3rdparty/chromium/base/third_party/double_conversion/double-conversion/bignum-dtoa.cc -o obj/base/third_party/double_conversion/double_conversion/bignum-dtoa.o
>> ../../../../qtwebengine-everywhere-src-5.15.2/src/3rdparty/chromium/base/third_party/double_conversion/double-conversion/bignum-dtoa.cc:28:10: fatal error: 'cmath' file not found
>> #include <cmath>
>>        ^~~~~~~
>> 1 error generated.
>> 
>> 
>> 
>> For reference:
>> 
>> # ~/fbsd-based-on-what-commit.sh -C /usr/ports/
>> branch: main
>> merge-base: 0a2f0da65b65bb9b3abf7a06815854f3cff063fa
>> merge-base: CommitDate: 2022-05-07 18:07:34 +0000
>> 0a2f0da65b65 (HEAD -> main) devel/py-tabulate: update to version 0.8.9
>> n582877 (--first-parent --count for merge-base)
>> 
>> # poudriere jail -jmain-CA7-bulk_a -i
>> Jail name:         main-CA7-bulk_a
>> Jail version:      14.0-CURRENT
>> Jail arch:         arm.armv7
>> Jail method:       null
>> Jail mount:        /usr/obj/DESTDIRs/main-CA7-poud-bulk_a
>> Jail fs:           
>> Jail updated:      2022-05-23 02:21:24
>> Jail pkgbase:      disabled
>> 
>> # uname -apKU # output line split for readability
>> FreeBSD CA72_UFS 14.0-CURRENT FreeBSD 14.0-CURRENT #56
>> main-n255745-77649f35a7e5-dirty: Sat May 21 18:48:32 PDT 2022
>> root@CA72_16Gp_ZFS:/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/sys/GENERIC-NODBG-CA72
>> arm64 aarch64 1400059 1400059
>> 
>> The jail is based on a armv7 build of the same source tree as
>> used for the above.
> 
> 

https://releases.llvm.org/13.0.0/tools/clang/docs/ReleaseNotes.html
does say:

QUOTE
	• -B <prefix> (when <prefix> is a directory) was overloaded to additionally detect GCC installations under <prefix> (lib{,32,64}/gcc{,-cross}/$triple). This behavior was incompatible with GCC, caused interop issues with --gcc-toolchain, and was thus dropped. Specify --gcc-toolchain=<dir> instead. -B’s other GCC-compatible semantics are preserved: $prefix/$triple-$file and $prefix$file are searched for executables, libraries, includes, and data files used by the compiler.
END QUOTE

But I do not know if the issue is related to the changes for this.

It is interesting that for 12 and before the description made no
mention of include or data files. For example,

https://releases.llvm.org/12.0.0/tools/clang/docs/ClangCommandLineReference.html

says:

QUOTE
-B<dir>, --prefix <arg>, --prefix=<arg>
Add <dir> to search path for binaries and object files used implicitly
END QUOTE

While:

https://releases.llvm.org/13.0.0/tools/clang/docs/ClangCommandLineReference.html

says:

QUOTE
-B<prefix>, --prefix <arg>, --prefix=<arg>
Search $prefix/$triple-$file and $prefix$file for executables, libraries, includes, and data files used by the compiler. $prefix may or may not be a directory
END QUOTE

Note 13's lack of a mention of a "search path" to be added to.

I'm afraid only the code allows reading to find out the detailed
behavior.

===
Mark Millard
marklmi at yahoo.com