[SERVER-63041] Linking error compiling on macOS with Zstandard asm Created: 27/Jan/22  Updated: 29/Oct/23  Resolved: 04/Mar/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0-rc3

Type: Improvement Priority: Major - P3
Reporter: Gregory Noma Assignee: Daniel Moody
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-49230 Evaluate upgrade of ZStandard to 1.4.9+ Closed
Backwards Compatibility: Fully Compatible
Sprint: Dev Platform 2022-02-21, Dev Platform 2022-03-07
Participants:

 Description   

For SERVER-49230 I ended up manually disabling asm on macOS due to a couple linking issues I came across.

First error:

ld: warning: object file (build/opt/third_party/zstandard/zstd/lib/decompress/huf_decompress_amd64.dyn.o) was built for newer macOS version (10.15) than being linked (10.14)

This appears to be the same as or similar to this issue.

Second error:

ld: warning: ignoring file build/opt/third_party/zstandard/zstd/lib/decompress/huf_decompress_amd64.dyn.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64

This one is specific to compiling via Rosetta 2.



 Comments   
Comment by Githook User [ 03/Mar/22 ]

Author:

{'name': 'Daniel Moody', 'email': 'daniel.moody@mongodb.com', 'username': 'dmoody256'}

Message: SERVER-63041 Add ASFLAGS on the command line for macos variables files to control.
Branch: master
https://github.com/mongodb/mongo/commit/31ab81e3b975433e36ea29e2071bd7d28392cda8

Comment by Gregory Noma [ 17/Feb/22 ]

Possibly related to this issue: https://github.com/facebook/zstd/issues/2963

Comment by Gregory Noma [ 27/Jan/22 ]

acm in terms of the latter, on other arm64 platforms there was no issue compiling. Presumably it was automatically excluding that file, but that wasn't the case with Rosetta 2.

Comment by Andrew Morrow (Inactive) [ 27/Jan/22 ]

For the first issue, I suspect we may need the -mmacosx-verison-min argument for invoking the compiler-as-assembler, so in ASFLAGS or similar. For the latter, we definitely want to exclude that file when targeting arm64.

Generated at Thu Feb 08 05:56:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.