Skip to content
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

Closed
xfix opened this issue Oct 28, 2013 · 7 comments
Closed

fish cannot be crosscompiled #1067

xfix opened this issue Oct 28, 2013 · 7 comments
Assignees
Milestone

Comments

@xfix
Copy link
Contributor

@xfix 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 mentioned this issue Oct 28, 2013
@zanchey
Copy link
Member

@zanchey 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.

Loading

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

@brandon099 brandon099 commented Jul 6, 2016

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

Loading

@krader1961
Copy link
Contributor

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

Loading

@zanchey zanchey self-assigned this Jul 6, 2016
@zanchey
Copy link
Member

@zanchey 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.

Loading

@zanchey zanchey removed their assignment Jul 6, 2016
zanchey added a commit to zanchey/fish-shell that referenced this issue Apr 29, 2019
Removes a compile-time check that may have affected cross-compilation.

Work on fish-shell#1067.
zanchey added a commit to zanchey/fish-shell that referenced this issue Apr 29, 2019
Removes a compile-time check that may have affected cross-compilation.

Work on fish-shell#1067.
@zanchey
Copy link
Member

@zanchey zanchey commented Apr 29, 2019

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.

Loading

@zanchey zanchey self-assigned this Apr 29, 2019
@floam
Copy link
Member

@floam floam commented Apr 29, 2019

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

Loading

zanchey added a commit that referenced this issue Apr 30, 2019
Removes a compile-time check that may have affected cross-compilation.

Work on #1067.
@zanchey
Copy link
Member

@zanchey zanchey commented Apr 30, 2019

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

Loading

@zanchey zanchey removed this from the fish-future milestone Aug 11, 2019
@zanchey zanchey added this to the fish 3.1.0 milestone Aug 11, 2019
@zanchey zanchey closed this Aug 11, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants