Skip to content

Implement getTargetInfo OSXVersion and FreeBSDVersion#22986

Draft
ibuclaw wants to merge 1 commit intodlang:masterfrom
ibuclaw:target_info_version
Draft

Implement getTargetInfo OSXVersion and FreeBSDVersion#22986
ibuclaw wants to merge 1 commit intodlang:masterfrom
ibuclaw:target_info_version

Conversation

@ibuclaw
Copy link
Copy Markdown
Member

@ibuclaw ibuclaw commented Apr 19, 2026

POC trait for dealing with vagary of FreeBSD and OSX versions.

DMD is a bit involved to pry out this information as it tries to be a cross-to-any compiler in a single binary.

GDC already has this information baked in its back-end, either because it only supports one OS version per compiler (as is the case with FreeBSD), or it's handled by a command-line option (-mmacosx-version-min= on OSX).

@dlang-bot
Copy link
Copy Markdown
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#22986"

@ibuclaw ibuclaw force-pushed the target_info_version branch from 055453d to 1fe73dc Compare April 19, 2026 21:10
@ibuclaw
Copy link
Copy Markdown
Member Author

ibuclaw commented Apr 20, 2026

@jmdavis you might be interesed in reviewing.

Copy link
Copy Markdown
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

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

Tests for CET? Also what is CET?

Comment thread compiler/src/dmd/target.d
Comment on lines +1396 to +1398
// Infer from -target= os version (i.e: freebsd13)
if (osMajor)
return osVersion(osMajor * 1_00_000);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

freebsd13.2 is also a valid triplet but the implementation in dmd to parse this ignores the minor version number.

Perhaps that should be fixed, as the same applies to darwin triplets too (though darwin19.1 and darwin20.1 might have two subtly different meanings between old and new macos versioning schemes)

@ibuclaw
Copy link
Copy Markdown
Member Author

ibuclaw commented Apr 20, 2026

Tests for CET? Also what is CET?

What are you talking about?

Intel CET is just their acronym for shadow stacks and indirect branch tracking.

@ibuclaw ibuclaw force-pushed the target_info_version branch 3 times, most recently from ccbe862 to b60301c Compare April 20, 2026 13:37
@ibuclaw ibuclaw force-pushed the target_info_version branch from b60301c to 8faed57 Compare April 20, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants