Skip to content

fix -mpopcnt compilation failure for v0.14#185

Merged
nmatschke merged 1 commit intojanestreet:v0.14from
liyishuai:fix-mpopcnt.0.14
Apr 15, 2026
Merged

fix -mpopcnt compilation failure for v0.14#185
nmatschke merged 1 commit intojanestreet:v0.14from
liyishuai:fix-mpopcnt.0.14

Conversation

@liyishuai
Copy link
Copy Markdown

Propagate #180

The problem arises from this bug in clang
llvm/llvm-project#116278
which causes the following:

```
$ cc t.c -mpopcnt
clang: error: unsupported option '-mpopcnt' for target 'arm64-apple-darwin24.4.0'
$ cc t.c -mpopcnt -lpthread
```

The src/discover uses dune configurator, which always appends
the C link flags from ocamlopt to the command line, and so the
configurator erronously thinks that -mpopcnt will work.

Since the dune configurator can't easily be overridden, this
PR works around this specific link order issue by hand-calling
the cc compiler from the discover binary.

fixes janestreet#164 and janestreet#168

Signed-off-by: Yishuai Li <liyishuai.lys@alibaba-inc.com>
@github-iron github-iron added the forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system. label Jul 9, 2025
@nmatschke
Copy link
Copy Markdown
Member

nmatschke commented Apr 14, 2026

@liyishuai is there any particular reason you can't upgrade to v0.17.3 or later?

@nmatschke nmatschke merged commit c42ead4 into janestreet:v0.14 Apr 15, 2026
1 check passed
@liyishuai liyishuai deleted the fix-mpopcnt.0.14 branch April 16, 2026 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants