Skip to content
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

go/build: Recognize .sx as equivalent to .S #32434

Closed
bdarnell opened this issue Jun 4, 2019 · 6 comments
Closed

go/build: Recognize .sx as equivalent to .S #32434

bdarnell opened this issue Jun 4, 2019 · 6 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bdarnell
Copy link

bdarnell commented Jun 4, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12.5 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/bdarnell/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/bdarnell/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.5/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.5/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/qx/.../tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I tried to rename an assembly file from lowercase .s to capital .S (PR) in order to use preprocessor directives in it.

What did you expect to see?

Renaming the file from lowercase .s to capital .S should cause the preprocessor directives to work.

What did you see instead?

Some combination of git and the macos filesystem (case-insensitive but case preserving) made the rename difficult. I had to change the base name of the file to make sure the rename "stuck".

This worked, but it would have been simpler if go recognized the suffix .sx for assembly files that use the preprocessor. This suffix is supported by gcc.

@ianlancetaylor ianlancetaylor added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels Jun 4, 2019
@ianlancetaylor ianlancetaylor added this to the Go1.14 milestone Jun 4, 2019
@ianlancetaylor
Copy link
Contributor

Seems reasonable to me.

@darkLord19
Copy link
Contributor

darkLord19 commented Jun 6, 2019

Hi, I am working with Go from past few months and I was thinking about contributing to Go. So if no one is working then I would like to work on this.

@darkLord19
Copy link
Contributor

After some code reading, I figured that I will need to update src/cmd/go/internal/work/exec.go and src/cmd/go/internal/work/gc.go mainly and some other places in internal/load accordingly. Can anyone explain how the go build works in an abstract way so that I can understand the working of current build toolchains and then add changes necessary for the issues? Thanks.
@ianlancetaylor

@agnivade
Copy link
Contributor

agnivade commented Jun 6, 2019

For general questions like these please reach out to the forums here on the Questions wiki page.

@ianlancetaylor
Copy link
Contributor

I understand that you are asking an abstract question, but it's a bit too abstract for me to know what the answer is. go build works by finding all the files in a package and building them.

My first guess, without looking at the code, would be that this could be done entirely in the go/build package by handling ".sx" files like ".S" files.

@gopherbot
Copy link

Change https://golang.org/cl/181699 mentions this issue: go/build: Recognize '.sx' as equivalent of '.S'

@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
@smasher164 smasher164 modified the milestones: Backlog, Go1.14 Oct 11, 2019
@golang golang locked and limited conversation to collaborators Oct 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants