#62717 closed defect (fixed)
net-snmp build fails on arm64 Undefined symbol _vm_region
Reported by: | p-b-west (Peter West) | Owned by: | ryandesign (Ryan Carsten Schmidt) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | arm64 | Cc: | fracai |
Port: | net-snmp |
Description
In the process of building gimp, build of net-snmp fails.
:info:build Undefined symbols for architecture arm64: :info:build "_vm_region", referenced from: :info:build _pages_swapped in memory_darwin.o
Attachments (1)
Change History (14)
Changed 4 years ago by p-b-west (Peter West)
comment:1 Changed 4 years ago by jmroot (Joshua Root)
Keywords: | arm64 added |
---|---|
Owner: | set to ryandesign |
Port: | net-snmp added |
Status: | new → assigned |
comment:2 Changed 3 years ago by fracai
Cc: | fracai added |
---|
comment:3 Changed 3 years ago by fracai
I'm also experiencing this error as a dep of sane-backends. Is there any additional information or testing that would be helpful in resolving this?
comment:4 follow-up: 5 Changed 3 years ago by fracai
I was able to get this a bit further by modifying: .../work/net-snmp-5.9/agent/mibgroup/hardware/memory/memory_darwin.c:81
to add || defined(__aarch64__)
to the end of the line.
Then the port fails with:
/usr/bin/clang -c -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_net-snmp/net-snmp/work/net-snmp-5.9/include -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch arm64 -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -DNETSNMP_REMOVE_U64 -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch arm64 -Udarwin20 -Ddarwin20=darwin20 -I/opt/local/include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -I. -I/opt/local/include -fno-common -DPERL_DARWIN -mmacosx-version-min=10.16 -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -fno-strict-aliasing -fstack-protector-strong -I/opt/local/include -DPERL_USE_SAFE_PUTENV -Wformat -O3 -DVERSION=\"5.09\" -DXS_VERSION=\"5.09\" "-I/opt/local/lib/perl5/5.28/darwin-thread-multi-2level/CORE" default_store.c clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk' [-Wmissing-sysroot] In file included from default_store.xs:2: /opt/local/lib/perl5/5.28/darwin-thread-multi-2level/CORE/perl.h:684:10: fatal error: 'sys/types.h' file not found #include <sys/types.h> ^~~~~~~~~~~~~ 1 error generated. make[2]: *** [default_store.o] Error 1 make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_net-snmp/net-snmp/work/net-snmp-5.9/perl/default_store' make[1]: *** [subdirs] Error 2 make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_net-snmp/net-snmp/work/net-snmp-5.9/perl' make: *** [perlmodules] Error 1 make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_net-snmp/net-snmp/work/net-snmp-5.9' Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_net-snmp/net-snmp/work/net-snmp-5.9" && /usr/bin/make -j8 -w all Exit code: 2 Error: Failed to build net-snmp: command execution failed DEBUG: Error code: CHILDSTATUS 63603 2 DEBUG: Backtrace: command execution failed DEBUG: while executing DEBUG: "system {*}$notty {*}$callback {*}$nice $fullcmdstring" DEBUG: invoked from within DEBUG: "command_exec -callback portprogress::target_progress_callback build" DEBUG: (procedure "portbuild::build_main" line 8) DEBUG: invoked from within DEBUG: "$procedure $targetname"
This looks similar to: #62227, #59951, #62440. So maybe a similar fix?
comment:5 follow-up: 6 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to fracai:
I was able to get this a bit further by modifying:
.../work/net-snmp-5.9/agent/mibgroup/hardware/memory/memory_darwin.c:81
to add|| defined(__aarch64__)
to the end of the line.
Thanks, I'll look into that. Is there an upstream bug report about this? If not, could you file one?
This looks similar to: #62227, #59951, #62440. So maybe a similar fix?
Presumably nothing beyond fixing #62440 is needed. Until that's done, you can rebuild perl5.28 from source using sudo port -ns upgrade --force perl5.28
but would likely need to do so again in the future (e.g. after you upgrade Xcode).
comment:6 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
comment:7 Changed 3 years ago by fracai
Thanks, I rebuilt perl5.28, cleaned and extracted net-snmp, re-applied the __aarch64__
definition, built and installed.
I'll open an upstream issue.
comment:8 follow-up: 9 Changed 3 years ago by fracai
Actually, it looks like there's already a resolved issue filed against the more recent 5.9.1 release.
https://github.com/net-snmp/net-snmp/issues/295
Which is linked to the homebrew PR: https://github.com/Homebrew/homebrew-core/pull/78122
It looks like just running autoreconf -fvi
prior to ./configure
allows a successful build.
This was outside of MacPorts so I'm not sure if the configure flags or patches would need to be changed as well.
comment:9 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to fracai:
Actually, it looks like there's already a resolved issue filed against the more recent 5.9.1 release.
That issue is not resolved, and it regards the error:
checking build system type... Invalid configuration `aarch64-apple-darwin20.4.0': machine `aarch64-apple' not recognized
which is not the error you reported. That issue could indeed be fixed by using autoreconf or maybe just using a newer config.guess & config.sub.
The error you reported was fixed in 5.9.1 in https://github.com/net-snmp/net-snmp/commit/bcc654e704f4794a9b10b8abf6e01f509402a6d3.
comment:10 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
comment:11 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
comment:12 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:13 Changed 3 years ago by fracai
Yep, just built and installed fine for me. Thanks for the updates.
Log file for net-snmp build