#define IDDEV_OFFSERIALNUM 10
#define IDDEV_OFFMODELNUM 27
#define IDDEV_OFFADDSUPPORT 69
+#define IDDEV_OFFA48SUPPORT 83
#define IDDEV_OFFALIGN 209
#define IDDEV_OFFLPP 106
#define IDDEV_OFFCAPABILITIES 49
dev_info->block_size = 512;
}
- if ((*(data + IDDEV_OFFADDSUPPORT) & 0x8)) {
+ if ((*(data + IDDEV_OFFADDSUPPORT) & 0x8) &&
+ (*(data + IDDEV_OFFA48SUPPORT) & 0x400)) {
dev_info->max_lba = *((uint64_t*)(data + IDDEV_OFFMAXLBA_EXT));
dev_info->flags |= HBA_DEV_FEXTLBA;
}
exit 255
fi
echo 'Downloading cross-compiler...'
- purple "=> gcc-10.4"
- if wget -T 5 -c --quiet --show-progress -P "$shell_folder"/tools/src https://ftp.gnu.org/gnu/gcc/gcc-10.4.0/gcc-10.4.0.tar.gz; then
+ purple "=> gcc-12.2.0"
+ if wget -T 5 -c --quiet --show-progress -P "$shell_folder"/tools/src https://ftp.gnu.org/gnu/gcc/gcc-12.2.0/gcc-12.2.0.tar.gz; then
green "gcc download success"
else
red 'gcc download fail, exiting... Re-run `bash init.sh -d` to continue gcc download'
green "Compile options: $binutils_configure"
echo "Extracting..."
sleep 3s
- if ! (tar xzf "$shell_folder"/tools/src/gcc-10.4.0.tar.gz); then
- red "extract gcc-10.4.0.tar.gz fail, exiting..."
+ if ! (tar xzf "$shell_folder"/tools/src/gcc-12.2.0.tar.gz); then
+ red "extract gcc-12.2.0.tar.gz fail, exiting..."
exit 255
fi
if ! (mkdir -p build-gcc); then
exit 255
fi
cd "$shell_folder"/tools/src/build-gcc || (red 'cd to build-gcc fail' ;exit)
- if ! (../gcc-10.4.0/configure --target=$TARGET --prefix="$PREFIX" $gcc_configure 2>&1 | tee "$log"/gcc-configure.log); then
- red "gcc-10.4.0 configure fail, exiting..."
+ if ! (../gcc-12.2.0/configure --target=$TARGET --prefix="$PREFIX" $gcc_configure 2>&1 | tee "$log"/gcc-configure.log); then
+ red "gcc-12.2.0 configure fail, exiting..."
exit 255
fi
if ! (make -j "$(nproc)" all-gcc 2>&1 | tee "$log"/gcc-make-all-gcc.log); then
- red "gcc-10.4.0 all-gcc make fail, exiting..."
+ red "gcc-12.2.0 all-gcc make fail, exiting..."
exit 255
fi
if ! (make -j "$(nproc)" all-target-libgcc 2>&1 | tee "$log"/gcc-make-all-target-libgcc.log); then
- red "gcc-10.4.0 all-target-libgcc make fail, exiting..."
+ red "gcc-12.2.0 all-target-libgcc make fail, exiting..."
exit 255
fi
if ! (make install-gcc 2>&1 | tee "$log"/gcc-make-install-gcc.log); then
- red "gcc-10.4.0 all-gcc make install fail, exiting..."
+ red "gcc-12.2.0 all-gcc make install fail, exiting..."
exit 255
- fi
+ fi
if ! (make install-target-libgcc 2>&1 | tee "$log"/gcc-make-install-target-libgcc.log); then
- red "gcc-10.4.0 all-target-libgcc make install fail, exiting..."
+ red "gcc-12.2.0 all-target-libgcc make install fail, exiting..."
exit 255
fi
green "gcc successfully compiled and installed"