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

freebsd/armv{6,7} lacks cpu profiler support (was: Doesn't install libprofiler and related files on armv6, armv7) #1355

Open
yurivict opened this issue Jul 12, 2022 · 8 comments

Comments

@yurivict
Copy link

I am not sure if this is intentional but these files aren't installed on armv7:

===>  Building package for google-perftools-2.10
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/google-perftools/work/stage/usr/local/include/gperftools/profiler.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/google-perftools/work/stage/usr/local/lib/libprofiler.a:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/google-perftools/work/stage/usr/local/lib/libprofiler.so:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/google-perftools/work/stage/usr/local/lib/libprofiler.so.0:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/google-perftools/work/stage/usr/local/lib/libprofiler.so.0.5.5:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/google-perftools/work/stage/usr/local/lib/libtcmalloc_and_profiler.a:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/google-perftools/work/stage/usr/local/lib/libtcmalloc_and_profiler.so:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/google-perftools/work/stage/usr/local/lib/libtcmalloc_and_profiler.so.4:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/google-perftools/work/stage/usr/local/lib/libtcmalloc_and_profiler.so.4.6.5:No such file or directory

Please not that libprofiler.pc is still installed.

Log: 2022-07-10T01:01:36.log

OS: FreeBSD 13.1

@alk
Copy link
Contributor

alk commented Jul 18, 2022

I know nothing about whatever pkg-static thing is doing, but lets start debugging with config.log. Can you attach it?

@yurivict
Copy link
Author

Unfortunately I only have access to failed build logs.
2022-07-15T14:15:54.log

@yurivict
Copy link
Author

The question is: Is it expected that libprofiler-related files aren't installed on armv7, or is this a bug in gperftools?

@alk
Copy link
Contributor

alk commented Jul 18, 2022

Cannot rule out any bug(s). But could it be that bsd+armv7 doesn't have working pc_from_ucontext bits setup?

AC_PC_FROM_UCONTEXT(AC_MSG_WARN(Could not find the PC. Will not try to compile libprofiler...);

again, config.log would prove/disprove this guess.

@yurivict
Copy link
Author

I looked at a complete failed log and can confirm that on armv7 it says:

checking how to access the program counter from a struct ucontext... configure: WARNING: Could not find the PC. Will not try to compile libprofiler...

Now the question is: why can't it find the PC on armv7? Is this expected or can be cured?

@yurivict yurivict changed the title Doesn't install libprofiler and related files on armv7 Doesn't install libprofiler and related files on armv6, armv7 Jul 18, 2022
@yurivict
Copy link
Author

The architecture armv6 has the same problem.

@yurivict
Copy link
Author

Please feel free to close this bug if armv6, armv7 are too old to be bothered with.
FreeBSD builds packages on these architectures and that's how I got alerted.

@alk
Copy link
Contributor

alk commented Jul 19, 2022

So the reason is ucontext bits are super-unportable. Means that in theory even different libcs on same OS and same cpu type could have different details there. That is why this autoconf bit has long list of things to try. I.e. what works for Linux+glibc might (but I have no idea if it really is) fail to work with other libcs. Let alone Linux vs bsd's.

So what is definitely worth fixing is not installing .pc and include files when profiler is not enabled or not supported. As for fixing arm6/arm7 specifically for BSD I'm leaving it up to whoever cares.

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Jul 19, 2022
Option for CPU profiler is mostly to isolate situations when
configure fails to enable it, like on armv6, armv7.

Reference: gperftools/gperftools#1355 (comment)
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Jul 19, 2022
Option for CPU profiler is mostly to isolate situations when
configure fails to enable it, like on armv6, armv7.

Reference: gperftools/gperftools#1355 (comment)
(cherry picked from commit 35bf4d1)
@alk alk changed the title Doesn't install libprofiler and related files on armv6, armv7 freebsd/armv{6,7} lacks cpu profiler support (was: Doesn't install libprofiler and related files on armv6, armv7) Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants