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

fish cannot be crosscompiled #1067

Open
xfix opened this Issue Oct 28, 2013 · 4 comments

Comments

Projects
None yet
5 participants
@xfix
Copy link
Member

xfix commented Oct 28, 2013

While compiling fish for Windows (32-bit version on 64-bit OS), I had a problem that fish refused to be compiled. This is caused by following code in configure.

#
# If we are compiling against glibc, set some flags to work around
# some rather stupid attempts to hide prototypes for *wprintf
# functions, as well as prototypes of various gnu extensions.
#

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we are compiling against glibc" >&5
$as_echo_n "checking if we are compiling against glibc... " >&6; }

if test "$cross_compiling" = yes; then :
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */


        #include <stdlib.h>
        #ifdef __GLIBC__
        #define STATUS 0
        #else
        #define STATUS 1
        #endif

int
main ()
{

        return STATUS;


  ;
  return 0;
}

_ACEOF
if ac_fn_cxx_try_run "$LINENO"; then :
  glibc=yes
else
  glibc=no

fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
fi

@xfix xfix referenced this issue Oct 28, 2013

Closed

Windows port? #319

@zanchey

This comment has been minimized.

Copy link
Member

zanchey commented Oct 29, 2013

See http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Runtime.html - the configure script uses AC_RUN_IFELSE in a few places. We would either need to come up with sensible defaults for those clauses for when cross-compiling, or alternatively rewrite them to compile/link only tests.

@ridiculousfish ridiculousfish added this to the fish-future milestone Oct 5, 2014

@brandon099

This comment has been minimized.

Copy link

brandon099 commented Jul 6, 2016

Trying to CC for an embedded linux project and would love to have fish available. +1

@krader1961

This comment has been minimized.

Copy link
Contributor

krader1961 commented Jul 6, 2016

@brandon099, Given this issue has been open nearly three years it's going to take someone like yourself who is motivated to make this work for it to be implemented. Pull-requests gladly accepted 😄

@zanchey zanchey self-assigned this Jul 6, 2016

@zanchey

This comment has been minimized.

Copy link
Member

zanchey commented Jul 6, 2016

I had a bit of a look, and there's a simple change and a complex one.

The simple change is to provide a crosscompilation default for the configure check for have_realpath_null.

The more complex change is to turn the configure-time check for /proc/self/stat into a runtime check.

I managed to successfully crosscompile by just forcing the /proc/self/stat check to always fail, but that's obviously not an appropriate solution.

@zanchey zanchey removed their assignment Jul 6, 2016

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