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

Fail to cross-compile racket for android. #4923

Open
Antigen-1 opened this issue Feb 4, 2024 · 3 comments
Open

Fail to cross-compile racket for android. #4923

Antigen-1 opened this issue Feb 4, 2024 · 3 comments

Comments

@Antigen-1
Copy link
Contributor

What version of Racket are you using?

racket -v
Welcome to Racket v8.11.1 [cs].

What program did you run?
I cross-compiled racket with android standalone toolchain.

./configure --prefix=$PWD/build --host=aarch64-linux-android31 --enable-racket=racket CC=aarch64-linux-android31-clang
make && make install

What should have happened?
Racket for aarch64-linux-android31 should have been built successfully and installed into $PWD/build.

If you got an error message, please include it here.

cs/c/local/cs/c/ChezScheme/ta6le/bin/ta6le/scheme -B cs/c/local/cs/c/ChezScheme/ta6le/boot/ta6le/petite.boot -B cs/c/local/cs/c/ChezScheme/ta6le/boot/ta6le/scheme.boot --script cs/c/to-vfasl.ss --xpatch cs/c/ChezScheme/xc-tarm64le/s/xpatch cs/c/ChezScheme/tarm64le/boot/tarm64le/petite.boot cs/c/petite-v.boot
Exception in load: failed for cs/c/ChezScheme/xc-tarm64le/s/xpatch: no such file or directory
failed
 in build-one
 in loop
 in module->hash

Please include any other relevant details

uname -a
Linux 192.168.10.91 6.6.14-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jan 26 20:12:16 UTC 2024 x86_64 GNU/Linux

Besides, for cross-compiling Racket CS, the --enable-scheme=SCHEME flag is required, where SCHEME is a Chez Scheme executable which, according to README.txt, does not need to match the Chez Scheme version as used in the Racket being built. I'd installed Chez Scheme for Racket 8.9 so I provided ./configure with --enable-scheme=scheme. But make complained about the version of Chez Scheme:

cross build needs Scheme with matching version
 in build-one
 in loop
 in module->hash

Actually I can go even further without providing --enable-scheme=scheme.

@mflatt
Copy link
Member

mflatt commented Feb 4, 2024

Thanks for the report! It appears that the build and the "README.txt" have gotten out of sync as we evolved the way that --enable-scheme and --enable-racket are used.

The valid options that should work:

  • using a matching Chez Scheme version, since the message turns out to be consistent with the current build implementation; you could build a matching version through the "ChezScheme" directory that is part of the Racket source

  • using --enable-racket=auto, which is probably the easiest way to go; that builds a host Racket and Chez Scheme along the way

I'll update the "README.txt" file with corrections, and I'll also make the build script detect the non-working combination of cross-compilation without --enable-racket=auto and without --enable-scheme=SCHEME.

@Antigen-1
Copy link
Contributor Author

Antigen-1 commented Feb 5, 2024

./configure --prefix=$PWD/build --enable-racket=auto --enable-scheme=$PWD/ChezScheme/ --host=arm-linux-androideabi CC=armv7a-linux-androideabi31-clang
make

An error occurs.

running /home/zhanghao/source/racket-8.11.1-src-builtpkgs/racket-8.11.1/src/ChezScheme//ChezScheme/ta6le/bin/ta6le/scheme to build cs/c/ChezScheme/xc-tarm32le/s/cmacros.so
exec failed
failed
 in build-one
 in loop
 in module->hash

There seems to be a problem about path handling.

PS:Unix Source + built packages is used here.

@Antigen-1
Copy link
Contributor Author

Antigen-1 commented Feb 5, 2024

I successfully build racket for arm-linux-android with --enable-scheme=SCHEME omitted.

./configure --prefix=$PWD/build --enable-racket=auto --host=arm-linux-androideabi CC=armv7a-linux-androideabi31-clang

I've read your corrections. When it says that for Racket CS, the --enable-scheme=SCHEME flag is required when not using --enable-racket=auto, is this intended to indicate that it is not allowed to use both --enable-racket and --enable-scheme at the same time?

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

No branches or pull requests

2 participants