Bug 15718 - Cross-compiler called through toolchain-wrapper generates bogus error messages
Summary: Cross-compiler called through toolchain-wrapper generates bogus error messages
Status: RESOLVED MOVED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2023.02
Hardware: All Linux
: P5 trivial
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-11 00:54 UTC by jimgeorge
Modified: 2024-06-15 15:12 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jimgeorge 2023-08-11 00:54:26 UTC
Cause:
Invoking the cross-compiler from the package generated by 'make sdk' with no arguments

Expected behavior:
Should print arm-linux-cc: fatal error: No input files

Observed behavior:
Output is:
/path/to/buildroot/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/11.3.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /path/to/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/Scrt1.o: in function `_start':
(.text+0x40): undefined reference to `main'
collect2: error: ld returned 1 exit status

With BR2_DEBUG_WRAPPER set to 2, I get the following extra information:

Toolchain wrapper was called with:
    'buildroot-ts/buildroot/output/host/bin/arm-linux-cc'
Toolchain wrapper executing:
    '/path/to/buildroot/output/host/bin/arm-linux-cc.br_real'
    '--sysroot'
    '/path/to/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot'
    '-fstack-protector-strong'
    '-fPIE'
    '-pie'
    '-Wl,-z,now'
    '-Wl,-z,relro'

When invoking arm-linux-cc with an example program to compile, behavior is normal. It seems like the 'Wl' options are what trigger the errors from the underlying gcc. Adding this as a 'trivial' bug so that it could either be documented or calling toolchain-wrapper with no arguments is special-cased so other buildroot newbies aren't tripped up by this.
Comment 1 Yann E. MORIN 2024-06-15 15:12:09 UTC
Thank you for your report.

The issue tracker for the Buildroot project has been moved to
the Gitlab.com issue tracker:
    https://gitlab.com/buildroot.org/buildroot/-/issues

We are taking this opportunity to close old issues in this old
tracker. If you believe your issue is still relevant, please
open one in the new issue tracker.

Thank you!