../../../../../../binutils-gdb/gprofng/libcollector/gethrtime.c: In function 'linux_gethrtime': ../../../../../../binutils-gdb/gprofng/libcollector/gethrtime.c:38:11: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration] 38 | int r = clock_gettime (CLOCK_MONOTONIC, &tp); | ^~~~~~~~~~~~~ ../../../../../../binutils-gdb/gprofng/libcollector/gethrtime.c:38:26: error: 'CLOCK_MONOTONIC' undeclared (first use in this function) 38 | int r = clock_gettime (CLOCK_MONOTONIC, &tp); | ^~~~~~~~~~~~~~~ ../../../../../../binutils-gdb/gprofng/libcollector/gethrtime.c:38:26: note: each undeclared identifier is reported only once for each function it appears in
i do canadian compilation for windows to build linux programs. gprofng simply does not correctly support windows host. Needs to block it in the build script
How do you configure your build ? gprofng should not be built for x86_64-w64-mingw32. Only these platforms are supported: % cat gprofng/configure.ac ... case "${target}" in x86_64-*-linux*) build_src=true build_collector=true ;; i?86-*-linux*) build_collector=true build_collector=true ;; aarch64-*-linux*) build_src=true build_collector=true ;; esac
(In reply to Vladimir Mezentsev from comment #2) > How do you configure your build ? > > gprofng should not be built for x86_64-w64-mingw32. > Only these platforms are supported: > > % cat gprofng/configure.ac > ... > case "${target}" in > x86_64-*-linux*) > build_src=true > build_collector=true > ;; > i?86-*-linux*) > build_collector=true > build_collector=true > ;; > aarch64-*-linux*) > build_src=true > build_collector=true > ;; > esac I do Canadian compilation for building cross back compiler. (Aka, the compiler is built on linux, hosted on windows, and targeting windows) Here the bug is that if target is linux but host is windows, your configure script would still build collector.
(In reply to Vladimir Mezentsev from comment #2) > How do you configure your build ? > > gprofng should not be built for x86_64-w64-mingw32. > Only these platforms are supported: > > % cat gprofng/configure.ac > ... > case "${target}" in > x86_64-*-linux*) > build_src=true > build_collector=true > ;; > i?86-*-linux*) > build_collector=true > build_collector=true > ;; > aarch64-*-linux*) > build_src=true > build_collector=true > ;; > esac the compiler runs on WINDOWS. but the compiled program runs on linux. The build process is again on linux. It is a crossback Canadian toolchain.
(In reply to Vladimir Mezentsev from comment #2) > How do you configure your build ? > > gprofng should not be built for x86_64-w64-mingw32. > Only these platforms are supported: > > % cat gprofng/configure.ac > ... > case "${target}" in > x86_64-*-linux*) > build_src=true > build_collector=true > ;; > i?86-*-linux*) > build_collector=true > build_collector=true > ;; > aarch64-*-linux*) > build_src=true > build_collector=true > ;; > esac case "${target}" in is clearly wrong. It should be ${host}, not ${target}
(In reply to Vladimir Mezentsev from comment #2) > How do you configure your build ? > > gprofng should not be built for x86_64-w64-mingw32. > Only these platforms are supported: > > % cat gprofng/configure.ac > ... > case "${target}" in > x86_64-*-linux*) > build_src=true > build_collector=true > ;; > i?86-*-linux*) > build_collector=true > build_collector=true > ;; > aarch64-*-linux*) > build_src=true > build_collector=true > ;; > esac Surely unrelated, but what's the effect of the apparent typo in the "i?86-*-linux*)" case?
The master branch has been updated by Vladimir Mezentsev <vmezents@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1653ae5b8440e2182ac86974b99b603bc15aa163 commit 1653ae5b8440e2182ac86974b99b603bc15aa163 Author: Vladimir Mezentsev <vladimir.mezentsev@oracle.com> Date: Thu May 5 00:08:19 2022 -0700 gprofng: use $host instead $target By mistake, $target was used instead of $host to configure the gprogng build. gprofng/ChangeLog 2022-04-28 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29113 PR gprofng/29116 * configure.ac: Use $host instead $target. * libcollector/configure.ac: Likewise. * configure: Rebuild. * libcollector/configure: Rebuild.
Has the problem been fixed in your build ?
Update status as resolved/fixed.