Skip to content

fish cannot be crosscompiled #1067

Closed
Closed

Description

@sugar700

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

Activity

  1. zanchey commented on Oct 29, 2013

    @zanchey
    Member

    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.

  2. added this to the fish-future milestone on Oct 5, 2014
  3. brandon099 commented on Jul 6, 2016

    @brandon099

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

  4. krader1961 commented on Jul 6, 2016

    @krader1961
    Contributor

    @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 😄

  5. self-assigned this
    on Jul 6, 2016
  6. zanchey commented on Jul 6, 2016

    @zanchey
    Member

    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.

  7. removed their assignment
    on Jul 6, 2016
  8. zanchey commented on Apr 29, 2019

    @zanchey
    Member

    have_realpath_null got dropped in 7fd3079, so I think it's just the /proc/self/stat that needs to be turned into a runtime check. I'll make a PR.

  9. self-assigned this
    on Apr 29, 2019
  10. floam commented on Apr 29, 2019

    @floam
    Member

    There are a few platforms where we should nonetheless be able to skip stating that path.

  11. zanchey commented on Apr 30, 2019

    @zanchey
    Member

    I think this should be possible now, but I'll wait to hear in #5848 before closing.

  12. locked as resolved and limited conversation to collaborators on Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions