Hi Mario,

crypt.setup<http://bugs.call-cc.org/browser/release/4/crypt/trunk/crypt.setup>has
some good ideas, thanks!

K.


On Tue, Jan 14, 2014 at 5:44 PM, Mario Domenech Goulart <
mario.goul...@gmail.com> wrote:

> Hi Kristian,
>
> On Tue, 14 Jan 2014 17:30:04 +0100 Kristian Lein-Mathisen <
> krist...@adellica.com> wrote:
>
> > I'm having some trouble compiling the socket egg with my CHICKEN
> > cross-compiler. I have a cross-compiler that compiles my eggs for my
> > host architecture (x86) and then my target (android):
> >
> > [user ~]$ aosp-chicken-install socket
> >
> > # installing for host works:
> >
> > 'host/linux-x86/chicken/bin/aosp-csi' -bnq -setup-mode -e "
> > (require-library setup-api)" -e "(import setup-api)" -e "
> > (setup-error-handling)" -e "(extension-name-and-version '(\"socket\"
> > \"0.2.5\"))" -e "(host-extension #t)" 'socket.setup'
> > 'host/linux-x86/chicken/bin/aosp-csc' -feature compiling-extension -
> > setup-mode -host socket-features.scm
> > ./socket-features > socket-config.scm
> >
> > # when it reaches target, it fails:
> >
> > 'host/linux-x86/chicken/bin/aosp-csi' -bnq -e "(require-library
> > setup-api)" -e "(import setup-api)" -e "(setup-error-handling)" -e "
> > (extension-name-and-version '(\"socket\" \"0.2.5\"))" -e "
> > (destination-prefix
> > \"/home/klm/cube/aosp-new/out/target/product/tr1imx6/system/\")" -e "
> > (runtime-prefix \"target/product/tr1imx6/system/\")" 'socket.setup'
> > 'host/linux-x86/chicken/bin/aosp-csc' -feature compiling-extension
> > socket-features.scm
> > ./socket-features > socket-config.scm
> > sh: ./socket-features: cannot execute binary file
> >
> > Error: shell command failed with nonzero exit status 32256:
> >
> > ./socket-features > socket-config.scm
> >
> > In socket.setup, we find these two lines:
> >
> > (compile socket-features.scm)
> > (run (./socket-features > socket-config.scm))
> >
> > And I think this is the cause of the trouble: The host machine cannot
> > execute the compiled target's binary executable to determine its
> > features.
> >
> > Specifying (compile -host socket-features.scm) was tempting, but it
> > incorrectly detects my target system to support SO_REUSEPORT which it
> > does not.
> >
> > Are there any good ways to fix this? I have noted the feature-test egg
> > uses this method in its documentation too.
>
> If I understand the problem correctly, eggs can't really try to detect
> target features when running on the host system.  When cross-compiling,
> I think you'll have to specify the features in advance (according to the
> target's profile) and skip the detection.
>
> The .setup from the crypt egg can be useful as an example.
>
> Best wishes.
> Mario
> --
> http://parenteses.org/mario
>
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to