这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@fjl
Copy link
Contributor

@fjl fjl commented Nov 25, 2020

Fixes #183

I've tried this for aarch64 and the resulting binary works.

@finagolfin finagolfin merged commit ac32e3a into termux:master Nov 26, 2020
@@ -1,8 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://common-lisp.net/project/ecl/
TERMUX_PKG_DESCRIPTION="ECL (Embeddable Common Lisp) is an interpreter of the Common Lisp language."
TERMUX_PKG_LICENSE="LGPL-2.0"

Choose a reason for hiding this comment

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

fwiw ecl is licensed under lgpl-2.1+, not lgpl-2.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I put LGPL-2.0 here because it says "Version 2" in https://gitlab.com/embeddable-common-lisp/ecl/-/blob/develop/COPYING

Choose a reason for hiding this comment

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

you are right, the included license is outdated (we already
bundle lgpl-2.1+ sources of other libraries)

(I will also need to change that), either way, since there is

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

it should be at least mentioned as lgpl-2.0+

@@ -0,0 +1,46 @@
TERMUX_PKG_HOMEPAGE=https://common-lisp.net/project/ecl/
TERMUX_PKG_DESCRIPTION="ECL (Embeddable Common Lisp) is an interpreter of the Common Lisp language."

Choose a reason for hiding this comment

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

ecl is a compiler with runtime, not an interpreter

Copy link
Contributor Author

@fjl fjl Nov 26, 2020

Choose a reason for hiding this comment

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

Hey @dkochmanski, good to see you here :). I just copied the first sentence from https://common-lisp.net/project/ecl/main.html. Happy to adjust it if you think it's not correct.

Choose a reason for hiding this comment

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

thanks, I need probably to rephrase it. If you are interested in details:
ecl always compiles the code (either with the bytecodes compiler or the c compiler), in the former case it executes the bytecode in a bytecode vm and that could be called interpreter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess it can be called an interpreter because python and most other scripting languages work the same way: compile to bytecode, then run that. ECL has the additional option of compiling to C.

Choose a reason for hiding this comment

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

I disagree, interpretation has a well defined meaning and it does not fit the model of compile->bytecode->execute. But I don't care enough to insist (especially that our own webpage is wrong :-)

@fjl
Copy link
Contributor Author

fjl commented Nov 26, 2020

@dkochmanski BTW, since you are reading this, it would be nice to have android cross_config definitions for 686 and x86_64 in the ECL repo. That would enable building ECL for all termux architectures.

@dkochmanski
Copy link

dkochmanski commented Nov 26, 2020

I'd rather fix the compiler altogether so it is possible to have a host with a different set of features (i.e so it is possible to cross-cc arm64 on x86)

// edit: but I don't know when it will happen, so if you submit a merge request with such definitions it will be probably merged

@fjl
Copy link
Contributor Author

fjl commented Nov 26, 2020

I'd rather fix the compiler altogether so it is possible to have a host with a different set of features

But this is what we're doing here, and it works! The package build runs on x86_64 and compiles ECL for aarch64 and arm (32bit).

The cross_config is just the output of some of the autoconf checks, right? Not sure how to generate these values, does it output such a file during ./configure ? Also, I don't have an x86_64 android device and therefore can't check what the values should be, though it might be possible to guess them from a normal linux/x86_64 build.

@dkochmanski
Copy link

dkochmanski commented Nov 26, 2020

I'm saying that it is impossible to cross-compile with host ECL 32-bit to target ECL 64-bit (and vice versa), for instance from x86 (not x86-64) to aarch64. I'm surprised that it works for x86-64 to arm32, but I don't remember the exact details of the issue.

cross_config also specifies some of the target machine features (i.e stack direction, size of various types, the file_cnt implementation of the target compiler etc). so yes, after a thought, cross configs for various targets would be still useful even after we fix the issue with not matching host/target number of bits.

@fjl
Copy link
Contributor Author

fjl commented Nov 26, 2020

I'm saying that it is impossible to cross-compile with host ECL 32-bit to target ECL 64-bit (and vice versa).

Hmm, so does this mean the arm (32bit) termux build of ECL is broken by definition? Because we are compiling that on 64bit. Can you verify? I don't have a 32bit arm phone, maybe you have one. Just install it with apt and check if it runs.

If it's currently impossible to compile 32bit ECL on a 64bit host, we might need to fix this package to build a 32bit host ECL when compiling for 32bit target.

@dkochmanski
Copy link

You may build for arm32 on x86-64 host, but you must build the host ecl with 32 bit, i.e

     ./configure ABI=32 CFLAGS="-m32 -g -O2" LDFLAGS="-m32 -g -O2"\
                 --prefix=`pwd`/ecl-android-host --disable-c99complex

no, I don't have 32bit phone. but if there were a problem, the compiler would complain and it would not build -- if it successfully produced a binary then it should be fine.

@fjl
Copy link
Contributor Author

fjl commented Nov 26, 2020

Yeah, I saw this in the INSTALL file, but didn't add it because the termux build infrastructure only does the host build once and then caches it. So testing this would be annoying because I'd need to find a way to reset the host build when compiling for arm32. Another potential issue is that the build environment container might not have a 32bit host libc and toolchain available (didn't try it).

If you say it should work if it compiles OK we can just leave it as is for now. I'll investigate it when I have another free night, but please note I'm just a random Termux user and CL enthusiast, might not get to it soon. You guys might also be able to fix it upstream in the meantime.

@dkochmanski
Copy link

Right. thank you for adding ecl to termux, I'm sure that this will benefit many people.

@Grimler91 Grimler91 mentioned this pull request Nov 27, 2020
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.

Package request: Common Lisp programming language compiler

3 participants