Skip to content

Add support for /dev/null input file#1471

Open
Steven Ramirez Rosa (Steven6798) wants to merge 1 commit into
qualcomm:mainfrom
Steven6798:issue-1464
Open

Add support for /dev/null input file#1471
Steven Ramirez Rosa (Steven6798) wants to merge 1 commit into
qualcomm:mainfrom
Steven6798:issue-1464

Conversation

@Steven6798

Copy link
Copy Markdown
Contributor

Fix: #1464

Comment thread lib/LinkerWrapper/GnuLdDriver.cpp Outdated
Comment thread lib/LinkerWrapper/GnuLdDriver.cpp Outdated
Comment thread lib/Input/InputAction.cpp Outdated
Fix: qualcomm#1464

Signed-off-by: Steven Ramirez Rosa <[email protected]>
@Steven6798 Steven Ramirez Rosa (Steven6798) changed the title Make /dev/null behave the same as missing input Add support for /dev/null input file Jul 14, 2026
@Steven6798 Steven Ramirez Rosa (Steven6798) added the bug Something isn't working label Jul 20, 2026
Comment thread test/Common/standalone/devnull/devnull.test
Comment thread lib/Input/InputAction.cpp

bool InputFileAction::activate(InputBuilder &PBuilder) {
// Skip null file.
if (eld::utility::isNullDevice(Name))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For a linker, is there any difference in /dev/null and an empty file, assuming that /dev/null is provided by the runtime/OS?

@Steven6798 Steven Ramirez Rosa (Steven6798) Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. both GNU ld and lld behave different in both cases.

$ ld.lld 
ld.lld: error: no input files
$ ld.lld /dev/null
ld.lld: error: target emulation unknown: -m or at least one .o file required
$ ld
ld: no input files
$ ld /dev/null
ld: warning: cannot find entry symbol _start; not setting start address

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for /dev/null input file

4 participants