Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#61325 closed defect (duplicate)

legacysupport 1.1 fails, but legacysupport 1.0 succeeds when building unbound @1.12.0_1: Undefined symbols "_arc4random_uniform"

Reported by: chrstphrchvz (Christopher Chavez) Owned by: nerdling (Jeremy Lavergne)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc: iefdev (Eric F)
Port: unbound legacy-support

Description

On macOS 10.6, unbound incorrectly detects arc4random_uniform() when configuring, even though it is only present on macOS 10.7 and later:

checking for arc4random_uniform... yes

This causes error when linking:

Undefined symbols for architecture x86_64:
  "_arc4random_uniform", referenced from:
      _ub_random_max in random.o
ld: symbol(s) not found for architecture x86_64

unbound appears to contain an implementation of arc4random_uniform() that it could use instead on macOS 10.6 and earlier.

Attachments (2)

unbound-fail-snowleopard-new-legacysupport-PG.log (186.9 KB) - added by kencu (Ken) 4 years ago.
unbound-succeed-snowleopard-old-legacysupport-PG.log (244.3 KB) - added by kencu (Ken) 4 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

I now notice this is already discussed in comments of [3abb85caeb/macports-ports]: the issue has something to do with legacysupport which is now used as of @1.12.0_1, and which provides arc4random_uniform() on macOS 10.6 and earlier. (The last 10.6 builds for @1.12.0_0 succeeded and didn't detect arc4random_uniform().)

comment:2 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

This issue has already been addressed by [82c510f48d/macports-ports]. (The issue existed when I drafted this ticket yesterday, but I did not check if it was resolved overnight.) This ticket can be closed.

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

Resolution: fixed
Status: assignedclosed

comment:4 Changed 4 years ago by kencu (Ken)

So using the original legacysupport PortGroup:

PortGroup           legacysupport 1.0

works perfectly, as expected. It finds arc4random_uniform and uses it as expected. The link succeeds just fine, the software is built.

However, using the newly-revised version:

PortGroup           legacysupport 1.1

fails with the missing symbol error.

The difference seems to be that the original links in the library using the shortname -lMacPortsLegacySupport whereas the 1.1 version (for some reason) links in with the entire library name instead.

I'm not sure that's it, but I don't see anything else different.

Must be the libtool, I guess? Not sure.

At any rate, the new PortGroup legacysupport 1.1 fails sometimes, whereas the old one works -- that much we know.

comment:5 Changed 4 years ago by kencu (Ken)

Port: legacy-support added
Resolution: fixed
Status: closedreopened
Summary: unbound @1.12.0_1: Undefined symbols "_arc4random_uniform"legacysupport 1.1 fails, but legacysupport 1.0 succeeds when building unbound @1.12.0_1: Undefined symbols "_arc4random_uniform"

Changed 4 years ago by kencu (Ken)

Changed 4 years ago by kencu (Ken)

comment:6 Changed 4 years ago by kencu (Ken)

I threw up the logs of the two builds.

We may have to fix the new legacysupport PG to work properly, once we sort out why it is failing. Otherwise people will think the new PG is the better, which it may not be at all times.

comment:7 Changed 4 years ago by kencu (Ken)

With the new legacysupport PG, the legacysupport library is not added to the link line at all:

old, succeeds:
:info:build libtool: link: /opt/local/bin/clang-mp-9.0 -dynamiclib  -o .libs/libunbound.8.dylib  .libs/context.o .libs/libunbound.o .libs/libworker.o .libs/ub_event_pluggable.o .libs/dns.o .libs/infra.o .libs/rrset.o .libs/dname.o .libs/msgencode.o .libs/as112.o .libs/msgparse.o .libs/msgreply.o .libs/packed_rrset.o .libs/iterator.o .libs/iter_delegpt.o .libs/iter_donotq.o .libs/iter_fwd.o .libs/iter_hints.o .libs/iter_priv.o .libs/iter_resptype.o .libs/iter_scrub.o .libs/iter_utils.o .libs/localzone.o .libs/mesh.o .libs/modstack.o .libs/view.o .libs/outbound_list.o .libs/alloc.o .libs/config_file.o .libs/configlexer.o .libs/configparser.o .libs/fptr_wlist.o .libs/edns.o .libs/locks.o .libs/log.o .libs/mini_event.o .libs/module.o .libs/net_help.o .libs/random.o .libs/rbtree.o .libs/regional.o .libs/rtt.o .libs/dnstree.o .libs/lookup3.o .libs/lruhash.o .libs/slabhash.o .libs/tcp_conn_limit.o .libs/timehist.o .libs/tube.o .libs/winsock_event.o .libs/autotrust.o .libs/val_anchor.o .libs/rpz.o .libs/validator.o .libs/val_kcache.o .libs/val_kentry.o .libs/val_neg.o .libs/val_nsec3.o .libs/val_nsec.o .libs/val_secalgo.o .libs/val_sigcrypt.o .libs/val_utils.o .libs/dns64.o .libs/cachedb.o .libs/redis.o .libs/authzone.o .libs/dnscrypt.o .libs/respip.o .libs/netevent.o .libs/listen_dnsport.o .libs/outside_network.o .libs/keyraw.o .libs/sbuffer.o .libs/wire2str.o .libs/parse.o .libs/parseutil.o .libs/rrdef.o .libs/str2wire.o .libs/strptime.o .libs/explicit_bzero.o .libs/reallocarray.o   -L/opt/local/lib -lMacportsLegacySupport -lssl /opt/local/lib/libsodium.dylib -lcrypto  -Os -arch x86_64 -pthread -Wl,-headerpad_max_install_names -arch x86_64   -pthread -install_name  /opt/local/lib/libunbound.8.dylib -compatibility_version 10 -current_version 10.10 -Wl,-single_module -Wl,-exported_symbols_list,.libs/libunbound-symbols.expsym
new, fails:
:info:build libtool: link: /opt/local/bin/clang-mp-9.0 -dynamiclib  -o .libs/libunbound.8.dylib  .libs/context.o .libs/libunbound.o .libs/libworker.o .libs/ub_event_pluggable.o .libs/dns.o .libs/infra.o .libs/rrset.o .libs/dname.o .libs/msgencode.o .libs/as112.o .libs/msgparse.o .libs/msgreply.o .libs/packed_rrset.o .libs/iterator.o .libs/iter_delegpt.o .libs/iter_donotq.o .libs/iter_fwd.o .libs/iter_hints.o .libs/iter_priv.o .libs/iter_resptype.o .libs/iter_scrub.o .libs/iter_utils.o .libs/localzone.o .libs/mesh.o .libs/modstack.o .libs/view.o .libs/outbound_list.o .libs/alloc.o .libs/config_file.o .libs/configlexer.o .libs/configparser.o .libs/fptr_wlist.o .libs/edns.o .libs/locks.o .libs/log.o .libs/mini_event.o .libs/module.o .libs/net_help.o .libs/random.o .libs/rbtree.o .libs/regional.o .libs/rtt.o .libs/dnstree.o .libs/lookup3.o .libs/lruhash.o .libs/slabhash.o .libs/tcp_conn_limit.o .libs/timehist.o .libs/tube.o .libs/winsock_event.o .libs/autotrust.o .libs/val_anchor.o .libs/rpz.o .libs/validator.o .libs/val_kcache.o .libs/val_kentry.o .libs/val_neg.o .libs/val_nsec3.o .libs/val_nsec.o .libs/val_secalgo.o .libs/val_sigcrypt.o .libs/val_utils.o .libs/dns64.o .libs/cachedb.o .libs/redis.o .libs/authzone.o .libs/dnscrypt.o .libs/respip.o .libs/netevent.o .libs/listen_dnsport.o .libs/outside_network.o .libs/keyraw.o .libs/sbuffer.o .libs/wire2str.o .libs/parse.o .libs/parseutil.o .libs/rrdef.o .libs/str2wire.o .libs/strptime.o .libs/explicit_bzero.o .libs/reallocarray.o   -L/opt/local/lib                         -lssl /opt/local/lib/libsodium.dylib -lcrypto  -Os -arch x86_64 -pthread -Wl,-headerpad_max_install_names -arch x86_64   -pthread -install_name  /opt/local/lib/libunbound.8.dylib -compatibility_version 10 -current_version 10.10 -Wl,-single_module -Wl,-exported_symbols_list,.libs/libunbound-symbols.expsym

comment:8 in reply to:  6 Changed 4 years ago by iefdev (Eric F)

Replying to kencu:

I threw up the logs of the two builds.

We may have to fix the new legacysupport PG to work properly, once we sort out why it is failing. Otherwise people will think the new PG is the better, which it may not be at all times.

Ken, would legacy-support help #60936?

comment:9 Changed 4 years ago by iefdev (Eric F)

Cc: iefdev added

comment:10 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: duplicate
Status: reopenedclosed

Duplicate of #60798.

comment:11 Changed 4 years ago by kencu (Ken)

ah, thanks for figuring that out.

Note: See TracTickets for help on using tickets.