Opened 3 years ago

Closed 3 years ago

#24652 closed defect (fixed)

Rust builds fail on macOS with linker error

Reported by: teor Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor Version: Tor:
Severity: Normal Keywords: rust, 032-backport, review-group-29
Cc: Actual Points:
Parent ID: Points: 0.1
Reviewer: Sponsor:


Both my gcc and clang builds get this error:

Undefined symbols for architecture x86_64:

  "_res_9_init", referenced from:

      std::sys::unix::net::res_init_if_glibc_before_2_26::h5cce5181e3d1daee in libtor_rust.a(

ld: symbol(s) not found for architecture x86_64

The Linux builds are fine, as are the non-Rust macOS builds.

Child Tickets

Change History (9)

comment:1 Changed 3 years ago by teor

This is an upstream issue:

We can fix it by linking our rust builds to -lresolv.

comment:2 Changed 3 years ago by teor

Points: 0.1

Adding LIBS=-lresolv to configure fixes this issue.
But I'm not sure how to modify so it's just added as a rust dependency.

comment:3 Changed 3 years ago by teor

Keywords: 032-backport added

comment:4 Changed 3 years ago by nickm

Owner: set to nickm
Status: newaccepted

comment:5 Changed 3 years ago by nickm

My branch bug24652_032 has a fix here that I think we should merge. It will have minor conflicts on master.

FWIW though when I run it, stuff builds, but the unit tests fail on OSX for me. I think that's a separate bug from this one, though. I've opened another ticket for that as #24795 .

comment:6 Changed 3 years ago by nickm

Status: acceptedneeds_review

comment:7 Changed 3 years ago by nickm

Keywords: review-group-29 added

comment:8 Changed 3 years ago by ahf

Status: needs_reviewmerge_ready

I haven't tested it locally, but the patch looks good to me.

comment:9 Changed 3 years ago by nickm

Resolution: fixed
Status: merge_readyclosed

merged it to 0.3.2 and forward!

Note: See TracTickets for help on using tickets.