Created
July 9, 2018 11:52
-
-
Save kimushu/9d30c2e83a248d1b17c8806fa222354d to your computer and use it in GitHub Desktop.
XC32 local build script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#================================================================================ | |
# LICENSE: GPLv2 | |
# | |
# This shell script is distributed under GPL v2.0 license | |
#================================================================================ | |
# Tested under Ubuntu 16.04 x86_64 and v2.05 source archives | |
#================================================================================ | |
#================================================================================ | |
# Parse command line options | |
#================================================================================ | |
work_dir=$(pwd) | |
build_dir=$work_dir/builddir | |
skip_check=0 | |
do_clean=0 | |
force_unpack=0 | |
skip_patch=0 | |
skip_pic32c=0 | |
skip_pic32m=0 | |
verbose=0 | |
xc32dir= | |
step_getopt() { | |
for opt in "$@" | |
do | |
shift | |
case $opt in | |
--skip-check) skip_check=1 ;; | |
--clean) do_clean=1 ;; | |
--force-unpack) force_unpack=1 ;; | |
--skip-patch) skip_patch=1 ;; | |
--skip-pic32c) skip_pic32c=1 ;; | |
--skip-pic32m) skip_pic32m=1 ;; | |
-v | --verbose) verbose=$(($verbose+1)) ;; | |
-h | --help) | |
cat << EOD | |
Usage: $0 <options> | |
Options: | |
--skip-check : Skip checking required build tools | |
--clean : Cleanup build directory before build | |
--force-unpack : Force unpacking archive | |
--skip-patch : Skip applying patch | |
--skip-pic32c : Skip build for PIC32C compiler | |
--skip-pic32m : Skip build for PIC32M compiler | |
-v,--verbose : Verbosity mode | |
-h,--help : Show this message | |
EOD | |
exit 1 | |
;; | |
--) break ;; | |
*) | |
echo "Unknown option: $opt" 1>&2 | |
exit 1 | |
;; | |
esac | |
done | |
if [ $verbose -gt 0 ]; then | |
for name in work_dir build_dir do_clean force_unpack skip_patch skip_pic32c skip_pic32m build_lm verbose | |
do | |
echo "Debug: (variable) $name=$(eval echo \$$name)" | |
done | |
fi | |
} | |
step_getopt $@ | |
cmd() { | |
if [ $verbose -gt 0 ]; then | |
echo "Debug: (command) $@" | |
fi | |
$@ | |
} | |
#================================================================================ | |
# Check build tools | |
#================================================================================ | |
step_check() { | |
test $skip_check -ne 0 && return | |
echo "Info: Checking build environments..." | |
temp=$(mktemp) | |
rec="" | |
gcc --version > /dev/null 2>&1 | |
if [ $? -ne 0 ]; then | |
echo "Error: \"gcc\" not found" | |
rec="$rec gcc" | |
fi | |
g++ --version > /dev/null 2>&1 | |
if [ $? -ne 0 ]; then | |
echo "Error: \"g++\" not found" | |
rec="$rec g++" | |
fi | |
gcc -m32 -o $temp -xc - << EOD > /dev/null 2>&1 | |
#include <stdio.h> | |
void main(void){ | |
puts("test"); | |
} | |
EOD | |
if [ $? -ne 0 ]; then | |
echo "Error: 32-bit libraries for gcc not found" | |
rec="$rec gcc-multilib" | |
fi | |
rm -f $temp | |
g++ -m32 -o $temp -xc++ - << EOD > /dev/null 2>&1 | |
#include <iostream> | |
using namespace std; | |
int main(void){ | |
cout << "test" << endl; | |
return 0; | |
} | |
EOD | |
if [ $? -ne 0 ]; then | |
echo "Error: 32-bit libraries for g++ not found" | |
rec="$rec g++-multilib" | |
fi | |
rm -f $temp | |
i686-w64-mingw32-gcc --version > /dev/null 2>&1 | |
if [ $? -ne 0 ]; then | |
echo "Error: \"i686-w64-mingw32-gcc\" not found" | |
rec="$rec gcc-mingw-w64" | |
fi | |
i686-w64-mingw32-g++ --version > /dev/null 2>&1 | |
if [ $? -ne 0 ]; then | |
echo "Error: \"i686-w64-mingw32-g++\" not found" | |
rec="$rec g++-mingw-w64" | |
fi | |
bison --version > /dev/null 2>&1 | |
if [ $? -ne 0 ]; then | |
echo "Error: \"bison\" not found" | |
rec="$rec bison" | |
fi | |
flex --version > /dev/null 2>&1 | |
if [ $? -ne 0 ]; then | |
echo "Error: \"flex\" not found" | |
rec="$rec flex" | |
fi | |
makeinfo --version > /dev/null 2>&1 | |
if [ $? -ne 0 ]; then | |
echo "Error: \"makeinfo\" not found" | |
rec="$rec texinfo" | |
fi | |
if [ "x$rec" != "x" ]; then | |
echo "Info: If you are using Ubuntu, please install following packages:" | |
echo " $rec" | |
exit 1 | |
fi | |
} | |
step_check | |
#================================================================================ | |
# Cleanup before build | |
#================================================================================ | |
step_clean() { | |
test $do_clean -eq 0 && return | |
echo "Info: Cleaning up build directory..." | |
cmd rm -rf $build_dir | |
echo "Info: Cleaning up unpacked files..." | |
cmd rm -rf $work_dir/common-source | |
cmd rm -rf $work_dir/pic32c-source | |
cmd rm -rf $work_dir/pic32m-source | |
} | |
step_clean | |
#================================================================================ | |
# Unpack source files and scripts | |
#================================================================================ | |
step_unpack() { | |
srczip=$(ls -1 xc32-v*-src.zip 2>/dev/null | sort | tail -1) | |
for archive in \ | |
pic32c-gcc-binutils:pic32c-source/XC32-arm-gcc/gcc \ | |
pic32c-newlib:pic32c-source/XC32-arm-gcc/newlib \ | |
pic32m-gcc-binutils:pic32m-source/src48x/gcc \ | |
pic32m-newlib:pic32m-source/pic32-newlib \ | |
xc32-build-scripts:common-source | |
do | |
case $archive in | |
pic32c-*) test $skip_pic32c -ne 0 && continue ;; | |
pic32m-*) test $skip_pic32m -ne 0 && continue ;; | |
esac | |
file=${archive%:*}.tar.bz2 | |
dir=${archive#*:} | |
if [ ! -e $dir/.unpacked ] || [ $force_unpack -ne 0 ]; then | |
if [ ! -e $file ]; then | |
if [ -z "$srczip" ]; then | |
echo "Error: Source archive (xc32-vX.XX-src.zip) not found!" | |
echo "Info: Please download from Microchip site!" | |
exit 1 | |
fi | |
echo "Info: Extracting $file ..." | |
cmd unzip $srczip $file || exit $? | |
fi | |
echo "Info: Unpacking $file ..." | |
cmd tar xf $file || exit $? | |
cmd touch $dir/.unpacked | |
else | |
echo "Info: $dir already exists. Skip unpacking." | |
fi | |
done | |
srcver=$(sed -n 's/^export MCHP_VERSION="\(.\+\)"$/\1/p' common-source/build-scripts/xc32-build-all.sh) | |
xclm= | |
if [ -n "$srcver" ]; then | |
echo "Info: Compiler version: $srcver" | |
xclm=$(ls -1 /opt/microchip/xc32/v$srcver/bin/xclm 2>/dev/null) | |
else | |
echo "Warning: Cannot detect compiler version." | |
fi | |
if [ -z "$xc32dir" ] && [ -z "$xclm" ]; then | |
xclm=$(ls -1 /opt/microchip/xc32/v*/bin/xclm 2>/dev/null | sort | tail -1) | |
if [ -z "$xclm" ]; then | |
echo "Error: Official XC32 not found!" | |
echo "Info: Please install official xc32 compiler into this machine." | |
exit 1 | |
fi | |
echo "Warning: Official XC32's version may be mismatch." | |
fi | |
xc32dir=$(dirname $(dirname $xclm)) | |
echo "Info: Official compiler found: $xc32dir" | |
for target in pic32c pic32m | |
do | |
case $target in | |
pic32c) test $skip_pic32c -ne 0 && continue ;; | |
pic32m) test $skip_pic32m -ne 0 && continue ;; | |
esac | |
dir=$target-source/$target-libs | |
zip=$xc32dir/pic32-libs/$target-libs.zip | |
if [ ! -e $dir/.unpacked ] || [ $force_unpack -ne 0 ]; then | |
echo "Info: Unpacking $zip ..." | |
cmd cd $(dirname $dir) | |
cmd unzip -qo $zip || exit 1 | |
cmd cd $work_dir | |
cmd touch $dir/.unpacked | |
else | |
echo "Info: $dir already exists. Skip unpacking." | |
fi | |
done | |
} | |
step_unpack | |
#================================================================================ | |
# Patch source files and scripts | |
#================================================================================ | |
step_patch() { | |
if [ $skip_patch -ne 0 ]; then | |
echo "Info: Patch has been skipped." | |
return | |
fi | |
try_patch() { | |
log=$1/.patched | |
test $force_unpack -ne 0 && cmd rm -f $log | |
if [ ! -e $log ]; then | |
echo "Info: Applying patch for $1" | |
cmd patch -p1 -t || (echo "Error: patch for $1 failed"; exit 1) | |
cmd touch $log | |
else | |
echo "Info: Patch for $1 has been already applied" | |
fi | |
} | |
try_patch common-source << 'EOD' | |
--- a/common-source/build-scripts/xc32-build-all.sh | |
+++ b/common-source/build-scripts/xc32-build-all.sh | |
@@ -45,7 +45,9 @@ | |
OPTIONS: | |
--skip_steps=STEPS specify which build steps you want to skip. Concatenate | |
them with comma for skipping more than one steps. Available | |
- steps are: checkout, pic32c, pic32m & source_tar. | |
+ steps are: checkout, manual, pic32c, pic32m & source_tar. | |
+ | |
+ --skip_lm=yes|no if yes, skip steps for build with LM | |
--branch=BRANCH specify the fossil branch to checkout | |
@@ -236,6 +238,9 @@ | |
skip_checkout=no | |
skip_source_tar=no | |
skip_steps= | |
+skip_lm=no | |
+skip_xc32_sh=no | |
+skip_manual=no | |
jobs_set=no | |
if [[ "x$XC32_JOBS" != "x" ]]; then | |
@@ -251,6 +256,10 @@ | |
--skip-steps=*) | |
skip_steps=`echo $ac_arg | sed -e "s/--skip_steps=//g" -e "s/,/ /g"` | |
;; | |
+ --skip_lm=yes|--skip_lm=no) | |
+ skip_lm=`echo $ac_arg | sed -e "s/--skip_lm=//g"` | |
+ status_update "skip_lm=$skip_lm" | |
+ ;; | |
--branch=*) | |
if [ "x$TAG" != "xx" ] ; then | |
echo "ERROR: Do not specify both --tag and --branch\n" | |
@@ -302,6 +311,14 @@ | |
status_update "skip_source_tar=yes" | |
skip_source_tar=yes | |
;; | |
+ xc32_sh) | |
+ status_update "skip_xc32_sh=yes" | |
+ skip_xc32_sh=yes | |
+ ;; | |
+ manual) | |
+ status_update "skip_manual=yes" | |
+ skip_manual=yes | |
+ ;; | |
*) | |
echo "Unknown build steps: $ss" 1>&2 | |
show_usage | |
@@ -372,6 +389,7 @@ | |
xc32_eval "$script_path/pic32c/build-pic32c-prerequisites.sh $JOBS_ARG" "Build pic32c prerequisites" | |
fi | |
+if [ "x$skip_xc32_sh" != "xyes" ]; then | |
if [[ $(uname -s) == "Darwin" ]] | |
then | |
@@ -392,21 +410,30 @@ | |
build_xc32_sh "$BUILDSUBDIR/install-Linux-nolm" "TARGET=linux" | |
build_xc32_sh "$BUILDSUBDIR/install-mingw" "TARGET=mingw" | |
fi | |
+fi # skip_xc32_sh | |
# Must come AFTER building the prerequisites | |
if [ -e "$script_path/xc32-extract-xclm.sh" ] ; then | |
xc32_eval "$script_path/xc32-extract-xclm.sh" | |
fi | |
- | |
if [ "x$skip_pic32m" == "xno" ] ; then | |
- xc32_eval "$script_path/pic32m/build-pic32m-toolchain.sh $PIC32M_JOBS_ARG" "Build pic32m toolchain" | |
+ opt="-l -c" | |
+ if [ "x$skip_manual" != "xno" ] ; then | |
+ opt="$opt -m" | |
+ fi | |
+ xc32_eval "$script_path/pic32m/build-pic32m-toolchain.sh $opt $PIC32M_JOBS_ARG" "Build pic32m toolchain" | |
fi | |
if [ "x$skip_pic32c" == "xno" ] ; then | |
-echo "command executed: $script_path/pic32c/build-pic32c-toolchain.sh --skip_steps=gdb-with-python,mingw32-gdb-with-python --build_type=native${DEVEL}${DEBUG} $JOBS_ARG" >> $LOGFILE | |
- bash $script_path/pic32c/build-pic32c-toolchain.sh --skip_steps=gdb-with-python,mingw32-gdb-with-python --build_type=native${DEVEL}${DEBUG} $JOBS_ARG | |
+ if [ "x$skip_manual" == "xno" ] ; then | |
+ manskip= | |
+ else | |
+ manskip=,manual | |
+ fi | |
+echo "command executed: $script_path/pic32c/build-pic32c-toolchain.sh --skip_lm=$skip_lm --skip_steps=gdb-with-python,mingw32-gdb-with-python$manskip --build_type=native${DEVEL}${DEBUG} $JOBS_ARG" >> $LOGFILE | |
+ bash $script_path/pic32c/build-pic32c-toolchain.sh --skip_lm=$skip_lm --skip_steps=gdb-with-python,mingw32-gdb-with-python$manskip --build_type=native${DEVEL}${DEBUG} $JOBS_ARG | |
assert_success $? "Build pic32c toolchain: pic32c/build-pic32c-toolchain.sh" | |
xc32_eval "$script_path/pic32c/build-pic32c-specs.sh" "Build and install pic32c spec files" | |
fi | |
--- a/common-source/build-scripts/pic32c/build-pic32c-toolchain.sh | |
+++ b/common-source/build-scripts/pic32c/build-pic32c-toolchain.sh | |
@@ -78,6 +78,8 @@ | |
steps are: gdb-with-python, mingw32, mingw32-gdb-with-python, | |
native, manual, and config. | |
+ --skip_lm=yes|no if yes, skip steps for build with LM | |
+ | |
--jobs=N specify the -j argument for make commands. | |
EOF | |
} | |
@@ -174,6 +176,7 @@ | |
skip_gdb_with_python=yes | |
skip_mingw32_gdb_with_python=yes | |
skip_config=no | |
+skip_lm=no | |
build_type= | |
build_tools= | |
@@ -185,6 +188,10 @@ | |
--skip_steps=*) | |
skip_steps=`echo $ac_arg | sed -e "s/--skip_steps=//g" -e "s/,/ /g"` | |
;; | |
+ --skip_lm=yes|--skip_lm=no) | |
+ skip_lm=`echo $ac_arg | sed -e "s/--skip_lm=//g"` | |
+ status_update "skip_lm=$skip_lm" | |
+ ;; | |
--build_type=*) | |
build_type=`echo $ac_arg | sed -e "s/--build_type=//g" -e "s/,/ /g"` | |
;; | |
@@ -849,6 +856,7 @@ | |
restoreenv | |
+if [ "x$skip_lm" != "xyes" ]; then | |
LOGTASKFILE=$WORKING_DIR/log-build-pic32c-Task-III-4-lm.txt | |
status_update " Task [III-4-lm] /$HOST_NATIVE/gcc-final/ LM" | |
echo Task [III-4-lm] /$HOST_NATIVE/gcc-final/ LM | |
@@ -962,6 +970,7 @@ | |
rm -f $INSTALLDIR_NATIVE/$TARGET_DIR/usr | |
popd | |
restoreenv | |
+fi # skip_lm | |
@@ -1233,6 +1242,7 @@ | |
echo Task [IV-3] /$HOST_MINGW/gcc-final/ | |
echo Task [IV-3] /$HOST_MINGW/gcc-final/ > $LOGTASKFILE | |
+if [ "x$skip_lm" != "xyes" ]; then | |
if [ "x$SHASUM256" != "x" ]; then | |
if [ ! -e $INSTALLDIR_MINGW/xclm/install/client/bin/xclm.exe ] ; then | |
assert_success -1 "ERROR: Missing $INSTALLDIR_MINGW/xclm/install/client/bin/xclm.exe" | |
@@ -1243,6 +1253,9 @@ | |
fi | |
XCLM_SHASUM_MACRO="-DMCHP_XCLM_SHA256_DIGEST=${XCLM_SHASUM} " | |
fi | |
+else # skip_lm | |
+XCLM_SHASUM_MACRO = "-DSKIP_LICENSE_MANAGER " | |
+fi # skip_lm | |
saveenv | |
--- a/common-source/build-scripts/pic32m/build-pic32m-toolchain.sh | |
+++ b/common-source/build-scripts/pic32m/build-pic32m-toolchain.sh | |
@@ -52,6 +52,8 @@ | |
SKIPRESOURCEFILE="" | |
SKIPPPL="yes" | |
SKIPCLOOG="yes" | |
+SKIPLM="" | |
+SKIPMANUALS="" | |
CVSB="trunk" | |
@@ -95,6 +97,9 @@ | |
echo " -L Skip MinGW32 build" | |
echo " -J <N> Specify the job count for make" | |
echo " -? Show this usage message" | |
+ echo " -l Skip LM build" | |
+ echo " -c Skip XC/XCpp library" | |
+ echo " -m Skip manuals" | |
exit 1 | |
} | |
@@ -268,7 +273,7 @@ | |
echo "Native image is $NATIVEIMAGE" | |
# Process the arguments | |
-while getopts b:FMNJ:Lt:Q opt | |
+while getopts b:FMNJ:Lt:Qlcm opt | |
do | |
case "$opt" in | |
t) | |
@@ -303,6 +308,20 @@ | |
TVAL=$OPTARG | |
JOBS="$TVAL" | |
;; | |
+ l) | |
+ echo "Skip LM" | |
+ SKIPNATIVE="yes" | |
+ SKIPLM="yes" | |
+ ;; | |
+ c) | |
+ echo "Skip XC/XCpp" | |
+ SKIPXCLIB="yes" | |
+ SKIPXCPPLIBS="yes" | |
+ ;; | |
+ m) | |
+ echo "Skip manuals" | |
+ SKIPMANUALS="yes" | |
+ ;; | |
\?) show_usage ;; | |
esac | |
done | |
@@ -667,6 +686,7 @@ | |
#if [ "x$SKIPREBUILD" == "x" ]; then | |
+if [ "x$SKIPXCLIB" == "x" ]; then | |
########################################################################## | |
# Install libc headers into cross compiler's install image directory | |
####################################################################### | |
@@ -714,6 +734,7 @@ | |
cd $WORKING_DIR | |
+fi # SKIPXCLIB | |
############################################# | |
######### Build XC Cpp Library ############## | |
############################################# | |
@@ -1559,7 +1580,7 @@ | |
LOGTASKFILE="$WORKING_DIR/log-build-pic32m-mingw-gcc.txt" | |
echo "Open $LOGTASKFILE" >$LOGTASKFILE | |
- if [ "x$SHASUM256" != "x" ]; then | |
+ if [ "x$SKIPLM" == "x" ] && [ "x$SHASUM256" != "x" ]; then | |
XCLM_SHASUM=`$SHASUM256 $INSTALLDIR_MINGW/bin/xclm.exe | head -c 64` | |
echo ${XCLM_SHASUM} >> $LOGFILE | |
echo ${XCLM_SHASUM} | |
@@ -1567,6 +1588,8 @@ | |
assert_success -1 "ERROR: Failed to calculate SHASUM256 digest for $INSTALLDIR_MINGW/bin/xclm.exe" | |
fi | |
XCLM_SHASUM_MACRO="-DMCHP_XCLM_SHA256_DIGEST=${XCLM_SHASUM} " | |
+ else | |
+ XCLM_SHASUM_MACRO="-DSKIP_LICENSE_MANAGER " | |
fi | |
cd $ROOT | |
CFLAGS="-O2" | |
EOD | |
try_patch pic32c-source/XC32-arm-gcc/libiconv-1.14 << 'EOD' | |
--- a/pic32c-source/XC32-arm-gcc/libiconv-1.14/lib/iconv.c | |
+++ b/pic32c-source/XC32-arm-gcc/libiconv-1.14/lib/iconv.c | |
@@ -179,7 +179,7 @@ | |
#ifdef __GNUC__ | |
__inline | |
#endif | |
-const struct alias * | |
+static const struct alias * | |
aliases2_lookup (register const char *str) | |
{ | |
const struct alias * ptr; | |
EOD | |
try_patch pic32m-source/src48x << 'EOD' | |
--- a/pic32m-source/src48x/gcc/gcc/cp/ChangeLog | |
+++ b/pic32m-source/src48x/gcc/gcc/cp/ChangeLog | |
@@ -1,2 +1,14 @@ | |
+2016-02-25 Bernd Edlinger <[email protected]> | |
+ | |
+ Backported from mainline | |
+ 2016-02-19 Jakub Jelinek <[email protected]> | |
+ Bernd Edlinger <[email protected]> | |
+ | |
+ * Make-lang.in: Invoke gperf with -L C++. | |
+ * cfns.gperf: Remove prototypes for hash and libc_name_p | |
+ inlines. | |
+ * cfns.h: Regenerated. | |
+ * except.c (nothrow_libfn_p): Adjust. | |
+ | |
2014-02-28 Jason Merrill <[email protected]> | |
--- a/pic32m-source/src48x/gcc/gcc/cp/Make-lang.in | |
+++ b/pic32m-source/src48x/gcc/gcc/cp/Make-lang.in | |
@@ -116,5 +116,5 @@ | |
$(srcdir)/cp/cfns.h: | |
endif | |
- gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ | |
+ gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \ | |
$(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h | |
--- a/pic32m-source/src48x/gcc/gcc/cp/cfns.gperf | |
+++ b/pic32m-source/src48x/gcc/gcc/cp/cfns.gperf | |
@@ -1,2 +1,4 @@ | |
+%language=C++ | |
+%define class-name libc_name | |
%{ | |
/* Copyright (C) 2000-2013 Free Software Foundation, Inc. | |
@@ -17,12 +19,4 @@ | |
along with GCC; see the file COPYING3. If not see | |
<http://www.gnu.org/licenses/>. */ | |
-#ifdef __GNUC__ | |
-__inline | |
-#endif | |
-static unsigned int hash (const char *, unsigned int); | |
-#ifdef __GNUC__ | |
-__inline | |
-#endif | |
-const char * libc_name_p (const char *, unsigned int); | |
%} | |
%% | |
--- a/pic32m-source/src48x/gcc/gcc/cp/cfns.h | |
+++ b/pic32m-source/src48x/gcc/gcc/cp/cfns.h | |
@@ -1,4 +1,4 @@ | |
-/* ANSI-C code produced by gperf version 3.0.3 */ | |
-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */ | |
+/* C++ code produced by gperf version 3.0.4 */ | |
+/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */ | |
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ | |
@@ -29,5 +29,5 @@ | |
#endif | |
-#line 1 "cfns.gperf" | |
+#line 3 "cfns.gperf" | |
/* Copyright (C) 2000-2013 Free Software Foundation, Inc. | |
@@ -48,23 +48,16 @@ | |
along with GCC; see the file COPYING3. If not see | |
<http://www.gnu.org/licenses/>. */ | |
-#ifdef __GNUC__ | |
-__inline | |
-#endif | |
-static unsigned int hash (const char *, unsigned int); | |
-#ifdef __GNUC__ | |
-__inline | |
-#endif | |
-const char * libc_name_p (const char *, unsigned int); | |
/* maximum key range = 391, duplicates = 0 */ | |
-#ifdef __GNUC__ | |
-__inline | |
-#else | |
-#ifdef __cplusplus | |
-inline | |
-#endif | |
-#endif | |
-static unsigned int | |
-hash (register const char *str, register unsigned int len) | |
+class libc_name | |
+{ | |
+private: | |
+ static inline unsigned int hash (const char *str, unsigned int len); | |
+public: | |
+ static const char *libc_name_p (const char *str, unsigned int len); | |
+}; | |
+ | |
+inline unsigned int | |
+libc_name::hash (register const char *str, register unsigned int len) | |
{ | |
static const unsigned short asso_values[] = | |
@@ -123,12 +116,6 @@ | |
} | |
-#ifdef __GNUC__ | |
-__inline | |
-#ifdef __GNUC_STDC_INLINE__ | |
-__attribute__ ((__gnu_inline__)) | |
-#endif | |
-#endif | |
const char * | |
-libc_name_p (register const char *str, register unsigned int len) | |
+libc_name::libc_name_p (register const char *str, register unsigned int len) | |
{ | |
enum | |
--- a/pic32m-source/src48x/gcc/gcc/cp/except.c | |
+++ b/pic32m-source/src48x/gcc/gcc/cp/except.c | |
@@ -1026,5 +1026,6 @@ | |
they are, we don't want to be confused by them. */ | |
id = DECL_NAME (fn); | |
- return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id)); | |
+ return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id), | |
+ IDENTIFIER_LENGTH (id)); | |
} | |
EOD | |
} | |
step_patch | |
#================================================================================ | |
# Setup build directory | |
#================================================================================ | |
step_setup() { | |
cmd mkdir -p $build_dir || exit 1 | |
if [ ! -e $build_dir/common-source ]; then | |
cmd ln -s $work_dir/common-source $build_dir/common-source | |
fi | |
if [ $skip_pic32c -eq 0 ]; then | |
if [ ! -e $build_dir/pic32c-source ]; then | |
cmd ln -s $work_dir/pic32c-source $build_dir/pic32c-source | |
fi | |
fi | |
if [ $skip_pic32m -eq 0 ]; then | |
if [ ! -e $build_dir/pic32m-source ]; then | |
cmd ln -s $work_dir/pic32m-source $build_dir/pic32m-source | |
fi | |
if [ ! -e $build_dir/pic32m-source/c30_resource ]; then | |
cmd ln -s $work_dir/pic32m-source/src48x/c30_resource $build_dir/pic32m-source/c30_resource | |
fi | |
if [ ! -e $build_dir/pic32m-source/pic32-libs ]; then | |
cmd ln -s $work_dir/pic32m-source/pic32m-libs $build_dir/pic32m-source/pic32-libs | |
fi | |
fi | |
} | |
step_setup | |
#================================================================================ | |
# Invoke build script | |
#================================================================================ | |
step_invoke() { | |
skips=checkout,source_tar,manual | |
if [ $skip_pic32c -ne 0 ]; then | |
skips=$skips,pic32c | |
fi | |
if [ $skip_pic32m -ne 0 ]; then | |
skips=$skips,pic32m | |
fi | |
cmd $work_dir/common-source/build-scripts/xc32-build-all.sh --skip_lm=yes --copy-xc32=$xc32dir --skip_steps=$skips | |
} | |
step_invoke | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm working on compiling the latest XC32 compiler v4.35 and have it compiling on both Linux Ubuntu 22.04 and Windows, for both PIC32M and PIC32Z, for anyone interested: https://github.com/ElectricRCAircraftGuy/Microchip_XC32_Compiler.