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

/android/prebuilts/misc/linux-x86/bison fails to run (Exec format error) #1687

Closed
markgross opened this issue Feb 10, 2017 · 5 comments
Closed

Comments

@markgross
Copy link

I am trying to build Android from the AOSP progject using Bash on windows. It looks like its getting close. However bash on windows has problems running the bison prebuilt tool.

To reproduce clone the prebuilts/misc git project and navigate to the bison folder and try to run bison.

945 git clone https://android.googlesource.com/platform/prebuilts/misc
946 cd misc/linux-x86/bison/
947 ls
948 ./bison

  • Expected results
    ./bison: ./bison: missing operand
    Try ./bison --help for more information.

  • Actual results (with terminal output if applicable)
    mgross@marks-x1:~/misc/linux-x86/bison$ ./bison
    -bash: ./bison: cannot execute binary file: Exec format error

  • Your Windows build number
    14986.rs_prerelease.161202-1928

  • Steps / All commands required to reproduce the error from a brand new installation
    945 git clone https://android.googlesource.com/platform/prebuilts/misc
    946 cd misc/linux-x86/bison/
    947 ls
    948 ./bison

  • Strace of the failing command
    mgross@marks-x1:~/misc/linux-x86/bison$ strace ./bison
    execve("./bison", ["./bison"], [/* 19 vars */]) = -1 ENOEXEC (Exec format error)
    write(2, "strace: exec: Exec format error\n", 32strace: exec: Exec format error
    ) = 32
    exit_group(1) =

  • Required packages and commands to install
    git

See our contributing instructions for assistance.

@markgross
Copy link
Author

BTW
mgross@marks-x1:~/misc/linux-x86/bison$ readelf -a bison
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Intel 80386
Version: 0x1
Entry point address: 0x804b880
Start of program headers: 52 (bytes into file)
Start of section headers: 1349828 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 8
Size of section headers: 40 (bytes)
Number of section headers: 39
Section header string table index: 36

objdump -a bison

bison: file format elf32-i386
bison

mgross@marks-x1:/misc/linux-x86/bison$ ldd bison
not a dynamic executable
mgross@marks-x1:
/misc/linux-x86/bison$

@aseering
Copy link
Contributor

Ah -- it's a 32-bit binary. WSL doesn't currently support 32-bit binaries ( #228 ).

This would be a hack -- but could you try installing bison from apt and using Ubuntu's version?

@benhillis
Copy link
Member

Marking as a duplicate of #390.

@markgross
Copy link
Author

Knowing the root cause is half the battle. I recomend this limitation to Bash on Windows be documented in getting started documentation.

Thanks! I will attempt the hack this weekend. Maybe it will work.

@aphilsmith
Copy link

Yes. I had to replace it with the Ubuntu (64-bit) version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants