-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Match standard 'ld' "search" behavior #38
Merged
tschwinge
merged 3 commits into
master
from
tschwinge/match_standard_ld_search_behavior
Nov 17, 2022
Merged
Match standard 'ld' "search" behavior #38
tschwinge
merged 3 commits into
master
from
tschwinge/match_standard_ld_search_behavior
Nov 17, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... matching standard 'ld' behavior.
... matching standard 'ld' behavior.
Hi, yes that looks ok to me. |
Hi!
Re
<#38 (comment)>:
On 2022-11-18T11:05:23-0800, I wrote:
Actually, in GCC/nvptx target testing, this #38's commit 886a95f "ld: Don't search for input files in '-L'directories" is generally causing linking to fail with:
```
error opening crt0.o
collect2: error: ld returned 1 exit status
compiler exited with status 1
```
I'm investigating.
OK to push the attached
GCC "nvptx: In 'STARTFILE_SPEC', fix 'crt0.o' for '-mmainkernel'" to all
active GCC branches? (... instead of having to restore this "blunder"
(do "search for input files in '-L'directories") in nvptx-tools...)
Grüße
Thomas
…-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
|
wangliu-iscas
pushed a commit
to plctlab/patchwork-gcc
that referenced
this pull request
Nov 19, 2022
A recent nvptx-tools change: commit 886a95faf66bf66a82fc0fe7d2a9fd9e9fec2820 "ld: Don't search for input files in '-L'directories" (of <SourceryTools/nvptx-tools#38> "Match standard 'ld' "search" behavior") in GCC/nvptx target testing generally causes linking to fail with: error opening crt0.o collect2: error: ld returned 1 exit status compiler exited with status 1 Indeed per GCC '-v' output, there is an undecorated 'crt0.o' on the linker ('collect2') command line: [...]/build-gcc/./gcc/collect2 -o [...] crt0.o [...] This is due to: gcc/config/nvptx/nvptx.h:#define STARTFILE_SPEC "%{mmainkernel:crt0.o}" ..., and the fix, as used by numerous other GCC targets, is to instead use 'crt0.o%s'; for '%s' means, per 'gcc/gcc.cc', "The Specs Language": %s current argument is the name of a library or startup file of some sort. Search for that file in a standard list of directories and substitute the full name found. With that, we get the expected path to 'crt0.o'. gcc/ * config/nvptx/nvptx.h (STARTFILE_SPEC): Fix 'crt0.o' for '-mmainkernel'.
On 11/19/22 00:25, Thomas Schwinge wrote:
Hi!
Re
<#38 (comment)>:
On 2022-11-18T11:05:23-0800, I wrote:
> Actually, in GCC/nvptx target testing, this #38's commit 886a95f "ld: Don't search for input files in '-L'directories" is generally causing linking to fail with:
>
> ```
> error opening crt0.o
> collect2: error: ld returned 1 exit status
> compiler exited with status 1
> ```
>
> I'm investigating.
OK to push the attached
GCC "nvptx: In 'STARTFILE_SPEC', fix 'crt0.o' for '-mmainkernel'" to all
active GCC branches? (... instead of having to restore this "blunder"
(do "search for input files in '-L'directories") in nvptx-tools...)
Hi,
yes, LGTM.
Thanks,
- Tom
…
Grüße
Thomas
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
|
vathpela
pushed a commit
to vathpela/gcc
that referenced
this pull request
Nov 19, 2022
A recent nvptx-tools change: commit 886a95faf66bf66a82fc0fe7d2a9fd9e9fec2820 "ld: Don't search for input files in '-L'directories" (of <SourceryTools/nvptx-tools#38> "Match standard 'ld' "search" behavior") in GCC/nvptx target testing generally causes linking to fail with: error opening crt0.o collect2: error: ld returned 1 exit status compiler exited with status 1 Indeed per GCC '-v' output, there is an undecorated 'crt0.o' on the linker ('collect2') command line: [...]/build-gcc/./gcc/collect2 -o [...] crt0.o [...] This is due to: gcc/config/nvptx/nvptx.h:#define STARTFILE_SPEC "%{mmainkernel:crt0.o}" ..., and the fix, as used by numerous other GCC targets, is to instead use 'crt0.o%s'; for '%s' means, per 'gcc/gcc.cc', "The Specs Language": %s current argument is the name of a library or startup file of some sort. Search for that file in a standard list of directories and substitute the full name found. With that, we get the expected path to 'crt0.o'. gcc/ * config/nvptx/nvptx.h (STARTFILE_SPEC): Fix 'crt0.o' for '-mmainkernel'.
kraj
pushed a commit
to kraj/gcc
that referenced
this pull request
Nov 19, 2022
A recent nvptx-tools change: commit 886a95faf66bf66a82fc0fe7d2a9fd9e9fec2820 "ld: Don't search for input files in '-L'directories" (of <SourceryTools/nvptx-tools#38> "Match standard 'ld' "search" behavior") in GCC/nvptx target testing generally causes linking to fail with: error opening crt0.o collect2: error: ld returned 1 exit status compiler exited with status 1 Indeed per GCC '-v' output, there is an undecorated 'crt0.o' on the linker ('collect2') command line: [...]/build-gcc/./gcc/collect2 -o [...] crt0.o [...] This is due to: gcc/config/nvptx/nvptx.h:#define STARTFILE_SPEC "%{mmainkernel:crt0.o}" ..., and the fix, as used by numerous other GCC targets, is to instead use 'crt0.o%s'; for '%s' means, per 'gcc/gcc.cc', "The Specs Language": %s current argument is the name of a library or startup file of some sort. Search for that file in a standard list of directories and substitute the full name found. With that, we get the expected path to 'crt0.o'. gcc/ * config/nvptx/nvptx.h (STARTFILE_SPEC): Fix 'crt0.o' for '-mmainkernel'. (cherry picked from commit dda43e1)
kraj
pushed a commit
to kraj/gcc
that referenced
this pull request
Nov 19, 2022
A recent nvptx-tools change: commit 886a95faf66bf66a82fc0fe7d2a9fd9e9fec2820 "ld: Don't search for input files in '-L'directories" (of <SourceryTools/nvptx-tools#38> "Match standard 'ld' "search" behavior") in GCC/nvptx target testing generally causes linking to fail with: error opening crt0.o collect2: error: ld returned 1 exit status compiler exited with status 1 Indeed per GCC '-v' output, there is an undecorated 'crt0.o' on the linker ('collect2') command line: [...]/build-gcc/./gcc/collect2 -o [...] crt0.o [...] This is due to: gcc/config/nvptx/nvptx.h:#define STARTFILE_SPEC "%{mmainkernel:crt0.o}" ..., and the fix, as used by numerous other GCC targets, is to instead use 'crt0.o%s'; for '%s' means, per 'gcc/gcc.cc', "The Specs Language": %s current argument is the name of a library or startup file of some sort. Search for that file in a standard list of directories and substitute the full name found. With that, we get the expected path to 'crt0.o'. gcc/ * config/nvptx/nvptx.h (STARTFILE_SPEC): Fix 'crt0.o' for '-mmainkernel'. (cherry picked from commit dda43e1)
kraj
pushed a commit
to kraj/gcc
that referenced
this pull request
Nov 19, 2022
A recent nvptx-tools change: commit 886a95faf66bf66a82fc0fe7d2a9fd9e9fec2820 "ld: Don't search for input files in '-L'directories" (of <SourceryTools/nvptx-tools#38> "Match standard 'ld' "search" behavior") in GCC/nvptx target testing generally causes linking to fail with: error opening crt0.o collect2: error: ld returned 1 exit status compiler exited with status 1 Indeed per GCC '-v' output, there is an undecorated 'crt0.o' on the linker ('collect2') command line: [...]/build-gcc/./gcc/collect2 -o [...] crt0.o [...] This is due to: gcc/config/nvptx/nvptx.h:#define STARTFILE_SPEC "%{mmainkernel:crt0.o}" ..., and the fix, as used by numerous other GCC targets, is to instead use 'crt0.o%s'; for '%s' means, per 'gcc/gcc.cc', "The Specs Language": %s current argument is the name of a library or startup file of some sort. Search for that file in a standard list of directories and substitute the full name found. With that, we get the expected path to 'crt0.o'. gcc/ * config/nvptx/nvptx.h (STARTFILE_SPEC): Fix 'crt0.o' for '-mmainkernel'. (cherry picked from commit dda43e1)
tschwinge
added a commit
that referenced
this pull request
Jun 22, 2023
Recent versions of 'ptxas' reject a '.visible' function declaration without accompanying definition: [...] FAIL: nvptx-tools :: ld/search-1.test (11 of 35) [...] + : 'RUN: at line 13' + [...]/nvptx-none-as -o [...]/test/ld/Output/search-1.test.tmp/o/GLOBAL_FUNCTION_DECL_f.o [...]/test/ld/../GLOBAL_FUNCTION_DECL_f.s ptxas fatal : Unresolved extern function 'f' nvptx-as: ptxas returned 255 exit status [...] ..., and indeed '.extern' is what GCC/nvptx generates for 'void f(); void *g = f;', for example. Fix-up for #38 commit 02a433c 'ld: Document current "search" behavior'.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@vries, agree?
No change in GCC/nvptx build behavior.