bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sr #110360] AC_CANONICAL_HOST sets wrong $host_cpu on Raspberry Pi 3


From: Zack Weinberg
Subject: [sr #110360] AC_CANONICAL_HOST sets wrong $host_cpu on Raspberry Pi 3
Date: Wed, 4 Nov 2020 10:59:39 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #9, sr #110360 (project autoconf):

I looked over spinhawk/configure.ac and I can now say with confidence that you
shouldn't override $host_cpu.  "armv7l" is *not* incorrect, just not
recognized as a -march= argument by GCC; changing it to start with "cortex"
will cause a whole bunch of "case $host_cpu in" blocks later in the configure
script to make the wrong choice.

I think the *proper* fix is for the code that sets $hc_cv_optimization_flags
(e.g. https://github.com/rbowler/spinhawk/blob/master/configure.ac#L1909)...


    case "$host_cpu-$GCC" in
...
        xscale-yes|arm*-yes)

            hc_cv_is_intel_x86_arch=no
            hc_cv_optimization_flags="$hc_cv_optimization_flags
-mcpu=$host_cpu -mtune=$host_cpu -frename-registers"
            ;;


to become aware that the value of $host_cpu is *not* necessarily usable as the
argument to either -mcpu= or -mtune=.  What I would recommend is for this
entire mess to be replaced with `-O2 -march=native -mtune=native` in native
compilation.  Cross compilation could continue to use $host_cpu as the
default, but a command-line option should be added (using AC_ARG_WITH) that
lets people set it to whatever specific thing they want.

I think this is not a bug in autoconf or automake, and should be re-filed as a
bug on spinhawk.  Viktor, it's probably best if you do that, but feel free to
cc: me on it (my Github handle is @zackw).

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?110360>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]