Skip to content

Skip --disable-new-dtags on Windows when TBB_LIB is set - #3415

Open
jgabry wants to merge 1 commit into
developfrom
bugfix/3414-windows-dtags
Open

jgabry wants to merge 1 commit into
developfrom
bugfix/3414-windows-dtags

Conversation

@jgabry

@jgabry jgabry commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #3414.

When TBB_LIB is set, make/compiler_flags adds -Wl,--disable-new-dtags
on every OS except macOS. On Windows both Rtools linkers reject it and every link
against an external TBB fails.

Noticed this when working on stan-dev/cmdstanr#1286.

Tests

There's no new test. The change is to the makefiles only, and CI doesn't
set TBB_LIB on Windows.

I had Claude check the resulting flags by including make/compiler_flags in a
small makefile and printing LDFLAGS_TBB with TBB_LIB=/x/lib:

Windows_NT: [-Wl,-L,/x/lib  ]
Linux:      [-Wl,-L,/x/lib -Wl,--disable-new-dtags -Wl,-rpath,/x/lib]
Darwin:     [-Wl,-L,/x/lib  -Wl,-rpath,/x/lib]

Side Effects

I don't think so. Linux and macOS get the same flags as before, and there's no effect for Windows
builds that don't set TBB_LIB.

Release notes

Setting TBB_LIB on Windows no longer adds --disable-new-dtags, which
the MinGW linkers reject.

Checklist

(I left some of the boxes unchecked since this is just a makefile change)

  • Copyright holder: Jonah Gabry

    The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
    - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
    - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • the basic tests are passing

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • dependencies checks pass, (make test-math-dependencies)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

@WardBrian WardBrian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good to go

@jgabry

jgabry commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

Cool, thanks for the quick review

@jgabry
jgabry enabled auto-merge September 24, 2026 17:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TBB_LIB on Windows adds --disable-new-dtags, which Rtools' linkers reject

2 participants