- Timestamp:
- 02/28/2024 04:02:53 PM (7 months ago)
- Branches:
- xry111/mips64el
- Children:
- 9d92ca9
- Parents:
- 959783e
- git-author:
- Xi Ruoyao <xry111@…> (01/03/2024 09:14:59 AM)
- git-committer:
- Xi Ruoyao <xry111@…> (02/28/2024 04:02:53 PM)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter05/gcc-pass1.xml
r959783e r2469049 75 75 cd build</userinput></screen> 76 76 77 <para>Probe the NaN encoding of the CPU:</para> 78 79 <screen><userinput remap="pre">cat > nan2008.c << \EOF 80 <literal>#include <stdio.h> 81 int main() 82 { 83 int x; 84 asm("cfc1\t%0,$31":"=r"(x)); 85 return !(x & 1 << 18); 86 }</literal> 87 EOF 88 gcc nan2008.c -o nan2008 89 if ./nan2008; then 90 NAN_SWITCH=--with-nan=2008 91 fi</userinput></screen> 92 77 93 <para>Prepare GCC for compilation:</para> 78 94 … … 80 96 --target=$LFS_TGT \ 81 97 --prefix=$LFS/tools \ 98 --with-arch=mips64r2 \ 82 99 --with-glibc-version=&glibc-version; \ 83 100 --with-sysroot=$LFS \ … … 96 113 --disable-libvtv \ 97 114 --disable-libstdcxx \ 98 --enable-languages=c,c++</userinput></screen> 115 --enable-languages=c,c++ \ 116 $NAN_SWITCH</userinput></screen> 99 117 <variablelist> 100 118 <title>The meaning of the configure options:</title> 119 120 <varlistentry> 121 <term><parameter>--with-arch=mips64r2</parameter></term> 122 <listitem> 123 <para>Set the default value of <option>-march=</option> to 124 mips64r2. Most distros use it as the baseline for the MIPS port, 125 so we are doing the same. You may change it if your CPU is not 126 compatible with mips64r2 (for example, mips3 or mips64r6), or 127 your CPU is stronger than mips64r2 and you don't care about the 128 compatibility with mips64r2, but we've not tested any setting 129 other than mips64r2.</para> 130 </listitem> 131 </varlistentry> 101 132 102 133 <varlistentry> … … 179 210 <para>This option ensures that only the C and C++ compilers are built. 180 211 These are the only languages needed now.</para> 212 </listitem> 213 </varlistentry> 214 215 <varlistentry> 216 <term><parameter>$NAN_SWITCH</parameter></term> 217 <listitem> 218 <para>If the CPU encodes NaN (Not a Number) values following 219 IEEE 754-2008 (indicated by the 16th bit of FCSR), this variable 220 will be set to <option>--with-nan=2008</option> so GCC will be 221 configured to use the IEEE 754-2008 encoding for NaN values as 222 the default. If this option is not properly set to match the CPU, 223 many Glibc and Python tests will fail because of the wrong NaN 224 encoding.</para> 181 225 </listitem> 182 226 </varlistentry>
Note:
See TracChangeset
for help on using the changeset viewer.