wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.25k stars 1.22k forks source link

linux/arm cross compilation failed #2060

Open aadog opened 2 years ago

aadog commented 2 years ago

Description

linux/arm cross compilation failed

To Reproduce

export CGO_ENABLED=1
export GOOS=linux
export GOARCH=arm
export CC=arm-linux-gnueabi-gcc
wails build  -platform="linux/arm"
dk@qt:/mnt/c/Users/qt970/src/wtest$ ./build.sh
Wails CLI v2.1.0

App Type:               desktop
Platforms:              linux/arm
Compiler:               /home/dk/go/bin/go
Skip Bindings:          false
Build Mode:             Production
Obfuscated:             false
Skip Frontend:          false
Compress:               false
Package:                true
Clean Build Dir:        false
LDFlags:                ""
Tags:                   []
Race Detector:          false
Output File:            aa

Building target: linux/arm
--------------------------
  - Generating bindings: Error: 
qemu-arm: Could not open '/lib/ld-linux.so.3': No such file or directory

exit status 255

ERROR:
qemu-arm: Could not open '/lib/ld-linux.so.3': No such file or directory

exit status 255

If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

···

### Expected behaviour

output binrary

### Screenshots

![image](https://user-images.githubusercontent.com/18098725/200378800-1232dd8a-f044-474c-8cdf-ffdb03581808.png)

### Attempted Fixes

all

### System Details

```shell
Linux version 5.15.68.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Mon Sep 19 19:14:52 UTC 2022    
cat: 2: No such file or directory

Additional context

No response

stffabi commented 2 years ago

Thanks for using Wails and reporting this issue.

I suspect you are facing the same issue as in #1921. Could you please try skipping building the bindings?

aadog commented 2 years ago

@stffabi yes

aadog commented 2 years ago

Output after modification

export QEMU_LD_PREFIX=/usr/arm-linux-gnueabi
export CGO_ENABLED=1
export GOOS=linux
export GOARCH=arm
export CC=arm-linux-gnueabi-gcc
#go build -tags desktop,production -ldflags "-w -s"
wails build  -platform="linux/arm" -o ./aa
dk@qt:/mnt/c/Users/qt970/src/wtest$ ./build.sh
Wails CLI v2.1.0

App Type:               desktop
Platforms:              linux/arm
Compiler:               /home/dk/go/bin/go
Skip Bindings:          false
Build Mode:             Production
Package:                true
Clean Build Dir:        false
LDFlags:                ""
Tags:                   []
Race Detector:          false
Output File:            ./aa

Building target: linux/arm
--------------------------
  - Generating bindings: Done.
  - Installing frontend dependencies: Done.
  - Compiling frontend: Done.
  - Compiling application: # github.com/wailsapp/wails/v2/internal/frontend/desktop/linux
In file included from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9,
                 from /usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/gtk-3.0/gdk/gdkconfig.h:13,
                 from /usr/include/gtk-3.0/gdk/gdk.h:30,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from /home/dk/go/pkg/mod/github.com/wailsapp/wails/v2@v2.1.0/internal/frontend/desktop/linux/dialog.go:13:
/usr/include/glib-2.0/glib/gtypes.h: In function '_GLIB_CHECKED_ADD_U64':
/usr/include/glib-2.0/glib/gmacros.h:738:31: error: static assertion failed: "Expression evaluates to false"
  738 | #define G_STATIC_ASSERT(expr) _Static_assert (expr, "Expression evaluates to false")
      |                               ^~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gtypes.h:463:3: note: in expansion of macro 'G_STATIC_ASSERT'
  463 |   G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
      |   ^~~~~~~~~~~~~~~
Error: exit status 2

ERROR: exit status 2

If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony
aadog commented 2 years ago

He seems to be using the native lib

epikoder commented 1 year ago

currently facing this same issue.. @aadog any luck passing this..

wails doctor

# System

OS           | Pop!_OS 
Version      | 22.04   
ID           | pop     
Go Version   | go1.18.1
Platform     | linux   
Architecture | amd64   

# Wails

Version         | v2.5.1
Package Manager | apt   

# Dependencies

Dependency | Package Name          | Status    | Version                  
*docker    | docker.io             | Available | 20.10.25-0ubuntu1~22.04.1
gcc        | build-essential       | Installed | 11.3.0                   
libgtk-3   | libgtk-3-dev          | Installed | 3.24.33-1ubuntu2         
libwebkit  | libwebkit2gtk-4.0-dev | Available | 2.40.4-0ubuntu0.22.04.1  
npm        | npm                   | Installed | 8.5.1~ds-1               
*nsis      | nsis                  | Available | 3.08-2                   
pkg-config | pkg-config            | Installed | 0.29.2                   
* - Optional Dependency

# Diagnosis

Your system has missing dependencies!
Required package(s) installation details: 
  - libwebkit: sudo apt install libwebkit2gtk-4.0-dev

Optional package(s) installation details: 
  - docker: sudo apt install docker.io
  - nsis: sudo apt install nsis
# Build Options

Platform(s)        | linux/arm                               
Compiler           | /usr/bin/go                             
Skip Bindings      | false                                   
Build Mode         | production                              
Frontend Directory | /home/efedua/Desktop/adepvis-v2/frontend
Obfuscated         | false                                   
Skip Frontend      | false                                   
Compress           | false                                   
Package            | true                                    
Clean Bin Dir      | false                                   
LDFlags            |                                         
Tags               | []                                      
Race Detector      | false     
  • Compiling application: 
# github.com/wailsapp/wails/v2/pkg/assetserver/webview
In file included from /usr/arm-linux-gnueabihf/include/features.h:510,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/arm-linux-gnueabihf/include/limits.h:26,
                 from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:11,
                 from /usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/gtk-3.0/gdk/gdkconfig.h:13,
                 from /usr/include/gtk-3.0/gdk/gdk.h:30,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from ../../go/pkg/mod/github.com/wailsapp/wails/v2@v2.5.1/pkg/assetserver/webview/request_linux.go:9:
/usr/include/x86_64-linux-gnu/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
    7 | # include <gnu/stubs-32.h>
      |           ^~~~~~~~~~~~~~~~
compilation terminated.