Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#57816 closed defect (fixed)

libre @0.6.0: Undefined symbols when linking libre.dylib

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: alfredh (Alfred E. Heggestad)
Priority: Normal Milestone:
Component: ports Version:
Keywords: mojave Cc:
Port: libre

Description

libre doesn't build on macOS Mojave:

  LD      libre.dylib
  AR      libre.a
Undefined symbols for architecture x86_64:
  "__mod_close", referenced from:
      _mod_destructor in mod.o
  "__mod_open", referenced from:
      _mod_load in mod.o
  "__mod_sym", referenced from:
      _mod_load in mod.o
  "_lock_alloc", referenced from:
      _rtcp_sess_alloc in sess.o
      _dynlock_create_handler in openssl.o
  "_lock_read_get", referenced from:
      _rtcp_stats in sess.o
      _rtcp_debug in sess.o
  "_lock_rel", referenced from:
      _rtcp_sess_tx_rtp in sess.o
      _rtcp_stats in sess.o
      _rtcp_debug in sess.o
      _mk_sr in sess.o
      _dynlock_lock_handler in openssl.o
  "_lock_write_get", referenced from:
      _rtcp_sess_tx_rtp in sess.o
      _mk_sr in sess.o
      _dynlock_lock_handler in openssl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libre.dylib] Error 1
make: *** Waiting for unfinished jobs....

It built fine on older macOS versions.

Attachments (1)

Portfile-libre.diff (385 bytes) - added by alfredh (Alfred E. Heggestad) 5 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 5 years ago by alfredh (Alfred E. Heggestad)

it is because the OSX system headers are not installed in /usr/include

can you install command-line tools on that build server?

http://icdevin.blogspot.com/2018/06/fixing-missing-headers-in-macos-mojave.html

comment:2 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

No, we don't want to do that, nor to require users to do that. Ports should work on Mojave without /usr/include being present.

comment:3 Changed 5 years ago by alfredh (Alfred E. Heggestad)

I added a patch to try to fix this, by forcing some build flags.

Could you please try to apply the patch and see if it fixes the Mojave build ?

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

We could do that... but it looks like the build system has a variable SYSROOT that can be set to the directory that contains the system includes. It defaults to /usr. You could set it to ${configure.sdkroot}/usr if ${configure.sdkroot} is not empty:

if {${configure.sdkroot} ne ""} {
    build.args-append SYSROOT="${configure.sdkroot}/usr"
}

Could we try that instead?

Changed 5 years ago by alfredh (Alfred E. Heggestad)

Attachment: Portfile-libre.diff added

comment:5 Changed 5 years ago by alfredh (Alfred E. Heggestad)

Thanks. I updated the Portfile patch with your suggested.

Tested ok on OSX 10.12

I am not able to test it on 10.14 at the moment.

comment:6 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In 7c46d37146d0afa3575bd22f0a13740bb00fe42c/macports-ports (master):

baresip, libre, librem: Specify SYSROOT

Fixes build when that's not /usr, e.g. on Mojave without /usr/include.

Closes: #57816

comment:7 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

In 9d0ccf6824ba34a224d676864d8a7fe3afbc1606/macports-ports (master):

restund: Specify SYSROOT

See: #57816

Note: See TracTickets for help on using tickets.