Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#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)

main.log (590.0 KB) - added by p-b-west (Peter West) 4 years ago.
Log file for net-snmp build

Download all attachments as: .zip

Change History (14)

Changed 4 years ago by p-b-west (Peter West)

Attachment: main.log added

Log file for net-snmp build

comment:1 Changed 4 years ago by jmroot (Joshua Root)

Keywords: arm64 added
Owner: set to ryandesign
Port: net-snmp added
Status: newassigned

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 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 in reply to:  4 ; 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 in reply to:  5 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

This looks similar to: #62227, #59951, #62440. So maybe a similar fix?

Presumably nothing beyond fixing #62440 is needed.

In fact we're tracking the issue for net-snmp separately in #59755.

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 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 in reply to:  8 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.

https://github.com/net-snmp/net-snmp/issues/295

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)

In 14550867dc80de80c13b04ce777bdf9097e3a35a/macports-ports (master):

net-snmp: Update to 5.9.1

See: #62717

comment:11 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

In f5bad90a0dbdf36a135c1adbfe1727427b18a0d5/macports-ports (master):

net-snmp: Update config.guess/config.sub for arm64

See: #62717

comment:12 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

comment:13 Changed 3 years ago by fracai

Yep, just built and installed fine for me. Thanks for the updates.

Note: See TracTickets for help on using tickets.