Hi,
First, before making BH work on a particular platform, doublecheck that Gambit works on it in itself. As you're aware, this is a pre-requirement.
Does Gambit work on Android, for you? If so, what configuration did you use?
What's your current goal, to get a complete environment with compilation and all running on the Android, or solely to make your Linux machine produce binaries runnable on the Android (including a REPL with interpreter)?
For resolving any compilation-related issues, you want Gambit to be verbose to you about exactly what C compiler and linker invocations it does, including all parameters passed.
Gambit invokes the C compiler and linker from the gambc-cc shellscript, and this script is verbose - outputs any C compiler and linker calls to the console - if it's run with the environment variable GAMBC_CC_VERBOSE set.
Thus, when starting the gsc you'll use for producing Android binaries, run it like this from bash: GAMBC_CC_VERBOSE=yes gsc
Now zooming in a bit on BH:I'm generating all 5 files like BH usually does.These 4 files are the part of Blackhole I understand least, but they are all needed for the module to be defined in C. According to Per:"When compiling modules for use in development (as opposed to "bh exe"), Black Hole works internally by compiling every module into 4 Gambit modules (c files if you will):1) runtime code2) compiletime code (this is essentially the same code as the runtime code, but does not use the global namespace and is thus slower but it's required to be able to create an unbound number of instances of the same module at any given time)3) visit-time code (these are the macros)4) module metadata (this is pretty much a compiled a-list)If you want to retain the development information, you will need 4 .c files per Black Hole module. If you want to strip development information, you will only need one (the runtime code)."I'm trying both with the 4 files and the only one option.
This is a good time to clarify, what's your goal within the following scope:
Basically, for code execution, only the runtime code C file is needed. (view this as the 'executable code' file.)
The total set of four files is needed to get a complete BH dev environment running. The reason for more than one file, is because BH needs to have several instances of each module "at hand", in order to get the macro expansion spinning the right way. The syntactic tower version of BH implements (exactly that;) the syntactic tower, appropriately and correctly, and this requires more than one instance of the module to be done the right way.
Thus, if your objective is to generate code that should be executable on the target environment and that's it, go with one file, otherwise go with all four.
(A)The multiple definition of symbols happens in both situations, but(B)an undefined reference happens for each one of the 3 files (I think that is due to the link file referencing them, I could take care of that). But the core of the problem is with the multiple definition of ___G_list, ___S_list, ___G_void and ___S_voidHow can this happen?
Is your point that (A) happens for either of the four files, while for the last three files (B) happens as well?
Producing and compiling with link files is indeed a bit tricky. To the best of my knowledge, the procedure to follow is something like this:
Make BH output C code:
(module-compile! 'yourmod to-c: t)
Now, for each of the C files you want to compile:
(link-flat '("yourmod.exact-c-file-filename") output: "yourmod.exact-c-file-filename.o1.c")
Then compile:
(include the other arguments your gsc passes to gcc, as per the advice at the top)
gcc yourmod.exact-c-file-filename yourmod.exact-c-file-filename.o1.c -o "yourmod.exact-c-file-filename.o1"
you could give a shot with:
g++ -Wall -W -Wno-unused -O1 -fno-math-errno -fschedule-insns2 -O1 -fno-math-errno -fschedule-insns2 -fno-trapping-math -fno-strict-aliasing -fwrapv -fomit-frame-pointer -fPIC -fno-common -mieee-fp -rdynamic -shared -I"/usr/include/" -D___DYNAMIC yourmod.exact-c-file-filename yourmod.exact-c-file-filename.o1.c -o "yourmod.exact-c-file-filename.o1"