Skip to content

feat: Select platform based on -flavor, arg0 then host#1873

Merged
davidlattimore merged 1 commit into
mainfrom
push-rskrvproxpvv
Apr 29, 2026
Merged

feat: Select platform based on -flavor, arg0 then host#1873
davidlattimore merged 1 commit into
mainfrom
push-rskrvproxpvv

Conversation

@davidlattimore

Copy link
Copy Markdown
Member

No description provided.

Comment thread libwild/src/args.rs Outdated

fn from_flavor(flavor: &str) -> Result<Self> {
match flavor {
"gnu" => Ok(PlatformKind::Elf),

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 didn't know/remember you can use gnu. I always used -flavor ld which is missing in this PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Btw. is it somewhere documented (the -flavor option) on the lld side?

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment thread libwild/src/args.rs Outdated
}

fn from_executable_name(name: &str) -> Option<Self> {
let base_name = Path::new(name).file_name().and_then(|n| n.to_str())?;

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.

Perhaps you want to use file_stem() here to futureproof.

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.

I assume you mean so we can call the symlink "ld.anything" rather than just "ld.wild". II can probably see cases where that might be useful, so I've done it.

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.

Oh sorry, I thought of Windows .exe extension for binaries. Now that you mention the symlinks, I'm less certain about the file_stem.

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.

It does mean that we can be invoked as "ld.lld" and work, which I did just yesterday since at the time I didn't know a better way to override the linker used by the chromium build process (I do now). The .exe extension is perhaps a good reason to accept it too

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.

Sure, glad that I could accidentally help.

@davidlattimore davidlattimore merged commit 6d2dc3e into main Apr 29, 2026
24 checks passed
@davidlattimore davidlattimore deleted the push-rskrvproxpvv branch April 29, 2026 21:26
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.

3 participants