467,225 Members | 1,319 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,225 developers. It's quick & easy.

-fno-strict-aliasing turned off when cross compiling

Does anyone have an idea why -fno-strict-aliasing is turned off when
cross compiling?

in configure generated for 2.4.4:

case $GCC in
yes)
# Python violates C99 rules, by casting between incompatible
# pointer types. GCC may generate bad code as a result of that,
# so use -fno-strict-aliasing if supported.
echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-
aliasing" >&5
echo $ECHO_N "checking whether $CC accepts -fno-strict-aliasing...
$ECHO_C" >&6
ac_save_cc="$CC"
CC="$CC -fno-strict-aliasing"
if test "$cross_compiling" = yes; then
ac_cv_no_strict_aliasing_ok=no
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ why?

else
Jan 16 '08 #1
  • viewed: 2601
Share:
3 Replies
Does anyone have an idea why -fno-strict-aliasing is turned off when
cross compiling?
Because detection of -fno-strict-aliasing is made through running
the compiler output (AC_TRY_RUN, see configure.in instead). For
cross-compilation, running the program isn't actually possible,
so a default must be specified. Since we can't know whether the
cross-compiler accepts -fno-strict-aliasing, we leave it out.

Regards,
Martin
Jan 17 '08 #2
On Jan 16, 10:56 pm, "Martin v. Lwis" <mar...@v.loewis.dewrote:
Does anyone have an idea why -fno-strict-aliasing is turned off when
cross compiling?

Because detection of -fno-strict-aliasing is made through running
the compiler output (AC_TRY_RUN, see configure.in instead). For
cross-compilation, running the program isn't actually possible,
so a default must be specified. Since we can't know whether the
cross-compiler accepts -fno-strict-aliasing, we leave it out.
This makes some sense. Thank you. As for this:

def detect_modules(self):
# Ensure that /usr/local is always used
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
add_dir_to_list(self.compiler.include_dirs, '/usr/local/
include')

it looks like a recipe for a disaster when cross compiling:
cc1: warning: include location "/usr/local/include" is unsafe for
cross-compilation
Jan 17 '08 #3
This makes some sense. Thank you. As for this:
>
def detect_modules(self):
# Ensure that /usr/local is always used
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
add_dir_to_list(self.compiler.include_dirs, '/usr/local/
include')

it looks like a recipe for a disaster when cross compiling:
cc1: warning: include location "/usr/local/include" is unsafe for
cross-compilation
Yes, Python doesn't really support cross-compilation. So you are
on your own.

Of course, in true cross-compilation, you won't get a chance to run
setup.py, since python will only run on the target system, not on
the host system, therefore setup.py won't even start, and it doesn't
matter that it won't support cross-compilation.

Regards,
Martin
Jan 17 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jeremy Schoenhaar | last post: by
1 post views Thread by nagesh | last post: by
reply views Thread by CptDondo | last post: by
1 post views Thread by Han-Wen Nienhuys | last post: by
3 posts views Thread by Randy Yates | last post: by
reply views Thread by winkatl1213@yahoo.com | last post: by
1 post views Thread by ac.c.2k7@gmail.com | last post: by
Dheeraj Joshi
8 posts views Thread by Dheeraj Joshi | last post: by
reply views Thread by Adict | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.