Skip to content

compiler: remove unnecessary main.main call workaround #1592

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

Merged
merged 1 commit into from
Jan 24, 2021

Conversation

aykevl
Copy link
Member

@aykevl aykevl commented Jan 24, 2021

Since #1571 (in particular, the first
commit that sets the main package path), the main package is always named
"main". This makes the callMain() workaround in the runtime unnecessary and
allows directly calling the main.main function with a //go:linkname pragma.

This is just a small refactor to clean up the code a bit.

Since #1571 (in particular, the first
commit that sets the main package path), the main package is always named
"main". This makes the callMain() workaround in the runtime unnecessary and
allows directly calling the main.main function with a //go:linkname pragma.
@deadprogram
Copy link
Member

Nice ✂️ merging.

@deadprogram deadprogram merged commit 92ed645 into dev Jan 24, 2021
@deadprogram deadprogram deleted the runtime-main-call branch January 24, 2021 21:53
aykevl added a commit to tinygo-org/drivers that referenced this pull request Jan 27, 2021
The package with the main function should always have the name main.
This was not the case in three packages.

This was silently allowed before, but since a TinyGo change
(tinygo-org/tinygo#1592) this now results in a
linker failure.

Perhaps this should result in a better error message in TinyGo. However,
the example code also needs to be fixed, so hence this PR.
deadprogram pushed a commit to tinygo-org/drivers that referenced this pull request Jan 27, 2021
The package with the main function should always have the name main.
This was not the case in three packages.

This was silently allowed before, but since a TinyGo change
(tinygo-org/tinygo#1592) this now results in a
linker failure.

Perhaps this should result in a better error message in TinyGo. However,
the example code also needs to be fixed, so hence this PR.
ardnew pushed a commit to ardnew/drivers that referenced this pull request Feb 14, 2021
The package with the main function should always have the name main.
This was not the case in three packages.

This was silently allowed before, but since a TinyGo change
(tinygo-org/tinygo#1592) this now results in a
linker failure.

Perhaps this should result in a better error message in TinyGo. However,
the example code also needs to be fixed, so hence this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants