[PATCH v3] Add -fuse-ld= to specify an arbitrary executable as the linker

Fangrui Song maskray@google.com
Fri May 22 04:42:07 GMT 2020

On 2020-05-21, Martin Liška wrote:
>On 5/21/20 1:52 AM, Fangrui Song wrote:
>>The above issues motivated me to touch this line in PATCH v2.
>>Dropped in PATCH v2.
>Thank you for the updated patch.
>The patch is fine except coding style issues:
>$ ./contrib/check_GNU_style.py /tmp/0001-Add-fuse-ld-to-specify-an-arbitrary-executable-as-th.patch
>=== ERROR type #1: blocks of 8 spaces should be replaced with tabs (4 error(s)) ===
>gcc/collect2.c:1135:0:████████ld_file_name = find_a_file(&cpath, ld_suffixes[selected_linker], X_OK);
>gcc/collect2.c:1137:0:████████ for `ld' (if native linking) or `TARGET-ld' (if cross).  */
>gcc/collect2.c:1139:0:████████ld_file_name =
>gcc/collect2.c:1140:0:████████    find_a_file(&path, full_ld_suffixes[selected_linker], X_OK);
>=== ERROR type #2: there should be exactly one space between function name and parenthesis (2 error(s)) ===
>gcc/collect2.c:1135:34:        ld_file_name = find_a_file(&cpath, ld_suffixes[selected_linker], X_OK);
>gcc/collect2.c:1140:23:            find_a_file(&path, full_ld_suffixes[selected_linker], X_OK);

Thank you. I did not know ./contrib/check_GNU_style.py

PATCH v3 fixes the above style issues and checks both cpath and path
which appears to make more sense (and compatible with clang).

>=== ERROR type #3: trailing operator (1 error(s)) ===
>gcc/collect2.c:1139:21:        ld_file_name =

but I can't fix this one because joining two lines will break the 80-column rule.
>Note that I can't approve the patch, please wait for a reviewer that can approve it.

I'll wait for a reviewer to approve and apply it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-fuse-ld-to-specify-an-arbitrary-executable-as-th.patch
Type: text/x-diff
Size: 4474 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200521/63941b4c/attachment.bin>

More information about the Gcc-patches mailing list