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

Add support for reading Go assembly files #3103

Closed
wants to merge 2 commits into from
Closed

Add support for reading Go assembly files #3103

wants to merge 2 commits into from

Conversation

aykevl
Copy link
Member

@aykevl aykevl commented Aug 28, 2022

This is a pretty big change that adds support for Go assembly files.
Go assembly files are different from standard assembly and can't be read
by tools like Clang. They also use a different calling convention. On
top of that, the tools that can read them (the gc toolchain) only output
custom (unstable) object files. In a previous attempt I tried to parse
these files but with this attempt I simply read the output of
go tool asm -S, which is a more-or-less stable text format (that,
importantly, includes the raw machine code and all relocations).

As a result:

So far, this is only for Linux (on all supported architectures: 386,
amd64, arm, arm64). Adding support for macOS and Windows should be
feasible by implementing the appropriate file formats (MachO and COFF).
It should be relatively easy to also add support for js/wasm. I'm not so
sure about other systems where the GOARCH doesn't match the actual
architecture, like WASI and most/all baremetal systems. It might be
possible to get them to work by lifting ARM machine code to LLVM IR, but
that will be quite some work in itself and certainly something for the
longer term.


This replaces #2688. It is still a draft because it depends on #3102 (math intrinsics) and #2904 (drop Go 1.16/1.17 support). It needs to be rebased on top of the dev branch once those PRs are in.

Comment on lines 86 to 91
// Create the alloca.
// WARNING: we're assuming here that this alloca will be the same as the
// stack pointer before the call in the assembly. This is not necessarily
// the case. But it seems to be working.
// I have tried many other approaches and this appears to be the most
// reliable way to do it.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not great, and I'd like to experiment with other ways of doing this once this is in. My main priority has been compatibility: making sure Go assembly works at all.

@deadprogram
Copy link
Member

Looks like macOS and Linux not passing CI on this @aykevl

@aykevl aykevl force-pushed the goasm3 branch 2 times, most recently from 52e7471 to 9e78487 Compare August 30, 2022 12:24
Makefile Outdated
@@ -346,7 +346,10 @@ TEST_PACKAGES_LINUX := \
testing/fstest \
text/template/parse

TEST_PACKAGES_DARWIN := $(TEST_PACKAGES_LINUX)
TEST_PACKAGES_LINUX := \
$(TEST_PACKAGES_LINUX) \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be TEST_PACKAGES_DARWIN ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct, thanks for spotting this! I've pushed a fix.

@deadprogram
Copy link
Member

Looks like needs merge conflict resolved @aykevl

@aykevl
Copy link
Member Author

aykevl commented Aug 30, 2022

Rebased to fix the merge conflict.

@aykevl
Copy link
Member Author

aykevl commented Sep 15, 2022

Can someone take a look at this? I have a number of other changes waiting for this PR to be merged.

@dgryski
Copy link
Member

dgryski commented Sep 16, 2022

I tried reviewing this, but there's too much compiler stuff I don't yet understand. Can we put this behind a flag temporarily so that it can be merged and allow us to do more tests before making it the default?

Also, is there anything inherently preventing this from working on Darwin, or just "haven't gotten around to it yet"?

@aykevl
Copy link
Member Author

aykevl commented Sep 16, 2022

I tried reviewing this, but there's too much compiler stuff I don't yet understand.

If you need help with anything, feel free to ask.

Can we put this behind a flag temporarily so that it can be merged and allow us to do more tests before making it the default?

I guess, but we'd have to review it some time anyway. Not sure what the advantage is. Avoiding breakage?

Also, is there anything inherently preventing this from working on Darwin, or just "haven't gotten around to it yet"?

I just need to write a port to MachO, shouldn't be too difficult. I already made one for Windows.
(Those are things I will make PRs for once this PR is in).

@dgryski
Copy link
Member

dgryski commented Sep 16, 2022

Yes. We can review it and test it more thoroughly without holding up other PRs and without creating large merge conflicts.

Glad to hear Darwin support is possible.

@kenbell
Copy link
Member

kenbell commented Sep 17, 2022

I think this change also means we can get rid of this 'hack' in the test cases: https://github.com/tinygo-org/tinygo/blob/dev/main_test.go#L173-L180

@aykevl
Copy link
Member Author

aykevl commented Sep 19, 2022

@dgryski I still don't understand why this feature should be disabled in the beginning? If it's disabled, that won't help with testing.
What is it exactly that you're proposing and what's the advantage of it?

I think this change also means we can get rid of this 'hack' in the test cases: https://github.com/tinygo-org/tinygo/blob/dev/main_test.go#L173-L180

Thanks, yes it does! Happy to see it go away. I've updated this PR.

@dgryski
Copy link
Member

dgryski commented Sep 19, 2022

@aykevl My goal with the merge but with flag to enable was to allow this to unblock other patches (as you said above) and give people the opportunity to test it more easily until we made it the default.

I'll try to understand this patch tonight and you can merge it (since it seems to be working.)

@dgryski
Copy link
Member

dgryski commented Sep 22, 2022

My suggestion is to run the test corpus, removing all the purego and noasm tags. If that passes, we can merge this and debug any issues as they come up.

@deadprogram
Copy link
Member

Just catching up on this PR. Did we ever perform the test suggested by @dgryski and if so do we consider it ready to merge?

@deadprogram
Copy link
Member

@dgryski and @aykevl have we performed the recommended tests and/or are we ready to merge this?

@dgryski
Copy link
Member

dgryski commented Oct 17, 2022

@dkegel-fastly You have a linux box. You want to take a look at running these tests?

@dkegel-fastly
Copy link
Contributor

will do

@aykevl
Copy link
Member Author

aykevl commented Feb 19, 2023

I wonder if we want to specialize the build tags per platform? Removing the asm ones breaks the corpus until Darwin asm support lands.

Sounds like a good idea!
Do you have a suggestion how to best add this to the yaml file? Separate build tags for linux/macos/windows for example?

@dgryski
Copy link
Member

dgryski commented Feb 19, 2023

That's probably the easiest. tags_linux, tags_darwin, tags_wasi. Hopefully we can avoid needing to add arm and amd64 variants.

@aykevl
Copy link
Member Author

aykevl commented Feb 28, 2023

That's probably the easiest. tags_linux, tags_darwin, tags_wasi.

Ok, will do.

Hopefully we can avoid needing to add arm and amd64 variants.

Actually, the test corpus doesn't pass on linux/arm64. I normally modify the test a bit like this to get it to work on linux/arm64:

--- a/corpus_test.go
+++ b/corpus_test.go
@@ -110,7 +110,7 @@ func TestCorpus(t *testing.T) {
                                out := ioLogger(t, &wg)
                                defer out.Close()
 
-                               opts := optionsFromTarget(target, sema)
+                               opts := optionsFromOSARCH("linux/amd64", sema)
                                opts.Directory = dir
                                var tags buildutil.TagsFlag
                                tags.Set(repo.Tags)

@aykevl aykevl marked this pull request as ready for review February 28, 2023 20:53
@aykevl
Copy link
Member Author

aykevl commented Feb 28, 2023

Please take another look. I've rebased the changes, added the new build tags in the test corpus, and squashed the goasm changes into a single commit.

Copy link
Member Author

aykevl commented Apr 26, 2023

^ reminder, can someone take a look at this?

@dgryski
Copy link
Member

dgryski commented Apr 27, 2023

I will.

@deadprogram deadprogram added this to the v0.29.0 milestone May 15, 2023
@deadprogram deadprogram modified the milestones: v0.29.0, v0.30.0 Jul 20, 2023
@deadprogram
Copy link
Member

@aykevl this PR needs to be rebased against the latest dev.

@dgryski can you please take a look to see if we can get this merged?

Thanks!

@deadprogram
Copy link
Member

@aykevl can you please rebase this PR one last time?

@dgryski if you can, please take a look. I will do the same, so we can get this merged early in this release cycle.

Thanks!

This is needed because some of these tags will be removed on Linux in
the next commit (but not on the other platforms).
This is a pretty big change that adds support for Go assembly files.
Go assembly files are different from standard assembly and can't be read
by tools like Clang. They also use a different calling convention. On
top of that, the tools that can read them (the gc toolchain) only output
custom (unstable) object files. In a previous attempt I tried to parse
these files but with this attempt I simply read the output of
`go tool asm -S`, which is a more-or-less stable text format (that,
importantly, includes the raw machine code and all relocations).

As a result:

  * This changes the math package, probably speeding up some algorithms
    (although I didn't benchmark them).
  * The crypto/aes package now works.
  * Undefined references to crypto/internal/boring/sig.StandardCrypto in
    Go 1.19 are fixed.

So far, this is only for Linux (on all supported architectures: 386,
amd64, arm, arm64). Adding support for macOS and Windows should be
feasible by implementing the appropriate file formats (MachO and COFF).
It should be relatively easy to also add support for js/wasm. I'm not so
sure about other systems where the GOARCH doesn't match the actual
architecture, like WASI and most/all baremetal systems. It might be
possible to get them to work by lifting ARM machine code to LLVM IR, but
that will be quite some work in itself and certainly something for the
longer term.
@aykevl
Copy link
Member Author

aykevl commented Oct 10, 2023

Rebased. It does show the following warning, which I haven't investigated yet:

$ go install; and tinygo test math
warning: GOPATH set to GOROOT () has no effect
warning: GOPATH set to GOROOT () has no effect
warning: GOPATH set to GOROOT () has no effect
warning: GOPATH set to GOROOT () has no effect
warning: GOPATH set to GOROOT () has no effect
warning: GOPATH set to GOROOT () has no effect
warning: GOPATH set to GOROOT () has no effect
ok      math    0.001s

@github-actions
Copy link

Size difference with the dev branch:

Binary size difference
not the same command!
    go: downloading golang.org/x/text v0.7.0
    tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/wifinina/ntpclient/main.go
not the same command!
    go: downloading golang.org/x/text v0.7.0
    tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/wifinina/udpstation/main.go
not the same command!
    go: downloading github.com/eclipse/paho.mqtt.golang v1.2.0
    tinygo build -size short -o ./build/test.hex -target=wioterminal ./examples/rtl8720dn/mqttsub/
 before   after   diff
  60960   60960      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adt7410/main.go
   9736    9736      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adxl345/main.go
  13268   13268      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/amg88xx
   8724    8724      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/main.go
  11612   11612      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/apds9960/proximity/main.go
   9784    9784      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/itsybitsy-m0/main.go
   8168    8168      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/at24cx/main.go
   8344    8344      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bh1750/main.go
   7632    7632      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/blinkm/main.go
  70492   70492      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pinetime     ./examples/bma42x/main.go
  63444   63444      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmi160/main.go
  27836   27836      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp180/main.go
  63544   63544      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp280/main.go
  12352   12352      0   0.00%  tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bmp388/main.go
   8128    8128      0   0.00%  tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/sram/main.go
  22100   22100      0   0.00%  tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/time/main.go
  69332   69332      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/main.go
   4704    4704      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/easystepper/main.go
  24932   24932      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/espat/espconsole/main.go
  25080   25080      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/espat/esphub/main.go
  24932   24932      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/espat/espstation/main.go
  68844   68844      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/flash/console/spi
  64916   64916      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/flash/console/qspi
   7040    7040      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/gc9a01/main.go
  68148   68148      0   0.00%  tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/i2c/main.go
  68544   68544      0   0.00%  tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/uart/main.go
   8372    8372      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/hcsr04/main.go
   5612    5612      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/customchar/main.go
   5656    5656      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/text/main.go
  10564   10564      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/hd44780i2c/main.go
  14516   14516      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/hts221/main.go
  16940   16940      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hub75/main.go
  10052   10052      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/basic
  10832   10832      0   0.00%  tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/basic
  29052   29052      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/pyportal_boing
  10080   10080      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/scroll
  10908   10908      0   0.00%  tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/scroll
 263564  263564      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/slideshow
  12052   12052      0   0.00%  tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis3dh/main.go
  13912   13912      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/lps22hb/main.go
  26124   26124      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/lsm303agr/main.go
  12520   12520      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/lsm6ds3/main.go
  10996   10996      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mag3110/main.go
  10176   10176      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017/main.go
  10604   10604      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017-multiple/main.go
   9816    9816      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp3008/main.go
  66920   66920      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp2515/main.go
  22984   22984      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/microbitmatrix/main.go
  22936   22936      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit-v2 ./examples/microbitmatrix/main.go
   8444    8444      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mma8653/main.go
   8356    8356      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mpu6050/main.go
  75196   75196      0   0.00%  tinygo build -size short -o ./build/test.hex -target=p1am-100 ./examples/p1am/main.go
  12148   12148      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pico ./examples/pca9685/main.go
   6080    6080      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setbuffer/main.go
   5100    5100      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setpixel/main.go
   2681    2681      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino ./examples/servo
   7944    7944      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/shifter/main.go
  56608   56608      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht3x/main.go
  56664   56664      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht4x/main.go
  56580   56580      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/shtc3/main.go
   6456    6456      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ssd1306/i2c_128x32/main.go
   5960    5960      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ssd1306/spi_128x64/main.go
   5676    5676      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ssd1331/main.go
   6376    6376      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7735/main.go
   6232    6232      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7789/main.go
  17156   17156      0   0.00%  tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/thermistor/main.go
  10312   10312      0   0.00%  tinygo build -size short -o ./build/test.hex -target=circuitplay-bluefruit ./examples/tone
  10096   10096      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/tm1637/main.go
   9404    9404      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/fourwire/main.go
  12468   12468      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/pyportal_touchpaint/main.go
  15804   15804      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl53l1x/main.go
  13848   13848      0   0.00%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl6180x/main.go
   6452    6452      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13/main.go
   6004    6004      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13x/main.go
   6260    6260      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd4in2/main.go
 137504  137504      0   0.00%  go: downloading golang.org/x/text v0.7.0
 137512  137512      0   0.00%  go: downloading golang.org/x/text v0.7.0
 137496  137496      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/wifinina/tcpclient/main.go
 137792  137792      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/wifinina/webclient/main.go
   6924    6924      0   0.00%  tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/ws2812
   5228    5228      0   0.00%  tinygo build -size short -o ./build/test.bin -target=m5stamp-c3          ./examples/ws2812
  61872   61872      0   0.00%  tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/is31fl3731/main.go
   1549    1549      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino   ./examples/ws2812
    880     880      0   0.00%  tinygo build -size short -o ./build/test.hex -target=digispark ./examples/ws2812
  32248   32248      0   0.00%  tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bme280/main.go
  16612   16612      0   0.00%  tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/microphone/main.go
  11268   11268      0   0.00%  tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/buzzer/main.go
  12976   12976      0   0.00%  tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/veml6070/main.go
   6800    6800      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/simple/main.go
   8720    8720      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/speed/main.go
   6764    6764      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l9110x/simple/main.go
   9336    9336      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l9110x/speed/main.go
   7304    7304      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nucleo-f103rb ./examples/shiftregister/main.go
   6932    6932      0   0.00%  tinygo build -size short -o ./build/test.hex -target=hifive1b ./examples/ssd1351/main.go
  13172   13172      0   0.00%  tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis2mdl/main.go
   8428    8428      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/max72xx/main.go
  77152   77152      0   0.00%  tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/dht/main.go
  36608   36608      0   0.00%  tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/pcf8523/
  71136   71136      0   0.00%  tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/alarm/
   7400    7400      0   0.00%  tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/clkout/
  70768   70768      0   0.00%  tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/time/
  71056   71056      0   0.00%  tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/timer/
  12076   12076      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pico ./examples/qmi8658c/main.go
   8996    8996      0   0.00%  tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/ina260/main.go
   9280    9280      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nucleo-l432kc ./examples/aht20/main.go
  72288   72288      0   0.00%  tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/sdcard/console/
  82580   82580      0   0.00%  tinygo build -size short -o ./build/test.hex -target=wioterminal ./examples/rtl8720dn/webclient/
  71996   71996      0   0.00%  tinygo build -size short -o ./build/test.hex -target=wioterminal ./examples/rtl8720dn/webserver/
  98644   98644      0   0.00%  go: downloading github.com/eclipse/paho.mqtt.golang v1.2.0
  60756   60756      0   0.00%  tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/i2csoft/adt7410/
  10152   10152      0   0.00%  tinygo build -size short -o ./build/test.elf -target=wioterminal ./examples/axp192/m5stack-core2-blinky/
   8916    8916      0   0.00%  tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/xpt2046/main.go
  14564   14564      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nucleo-wl55jc ./examples/sx126x/lora_rxtx/
  26260   26260      0   0.00%  tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/ssd1289/main.go
  11188   11188      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pico ./examples/irremote/main.go
  11204   11204      0   0.00%  tinygo build -size short -o ./build/test.hex -target=badger2040 ./examples/uc8151/main.go
  10312   10312      0   0.00%  tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/scd4x/main.go
   8692    8692      0   0.00%  tinygo build -size short -o ./build/test.uf2 -target=circuitplay-express ./examples/makeybutton/main.go
   9576    9576      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ds18b20/main.go
  81312   81312      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nucleo-wl55jc ./examples/lora/lorawan/atcmd/
  15732   15732      0   0.00%  tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/as560x/main.go
   9800    9800      0   0.00%  tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mpu6886/main.go
   7840    7840      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ttp229/main.go
  66056   66056      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pico ./examples/ndir/main_ndir.go
  61368   61368      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ndir/main_ndir.go
  64616   64616      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ndir/main_ndir.go
   9216    9216      0   0.00%  tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mpu9150/main.go
3826946 3826946      0   0.00%   sum

@deadprogram
Copy link
Member

It does show the following warning, which I haven't investigated yet.

OK I will hold off on merging until you say so @aykevl

@jclab-joseph
Copy link

I found this PR while looking for an issue in tinygo that prevented me from using asm in the default package.
Thanks for your contribution! I look forward to the day when this becomes a reality :)

@dgryski
Copy link
Member

dgryski commented Nov 9, 2023

@jclab-joseph What package are you trying to use? Frequently a pure-Go implementation can be selected with the correct build tags.

@jclab-joseph
Copy link

@dgryski Yes, I have been using it that way.
However, I would like to use AES-NI on x86. This requires asm.

@MDr164
Copy link

MDr164 commented Nov 20, 2023

Anything I can do to help move this PR forward?

@aykevl
Copy link
Member Author

aykevl commented Feb 25, 2024

I think the general idea is that #4116 is the way forward, instead of trying to implement support for Go assembly in an extremely hacky way (that wouldn't support microcontrollers anyway). So closing 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.

8 participants