Но у меня есть некоторые проблемы. Я не хочу использовать "Docker".
для Bison 2.3 и Flex 2.5.4, поэтому я его решил.
, затем попытался скомпилировать Uclinux, но это требует GCC 4.8.5. < /P>
ЗДЕСЬ.
Код: Выделить всё
sudo apt update< /code>
sudo apt install build-essential libgmp-dev libmpfr-dev libmpc-dev wgetКод: Выделить всё
wget https://mirrors.kernel.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.gz
tar -xvzf gcc-4.8.5.tar.gz
cd ~/Documents/gcc-4.8.5
# Apply comprehensive patch set
sed -i 's/struct ucontext/ucontext_t/g' libgcc/config/i386/linux-unwind.h
sed -i 's/struct siginfo/siginfo_t/g' libgcc/config/i386/linux-unwind.h
sed -i '/#include
/a #include ' libsanitizer/asan/asan_linux.cc
sed -i 's/__res_state statp = (__res_state)state;/struct __res_state statp = (struct __res_state)state;/g' libsanitizer/tsan/tsan_platform_linux.cc
sed -i 's/typeof/__typeof__/g' libitm/config/linux/rwlock.cc
sed -i '/#include /a #include ' libitm/config/linux/rwlock.cc
sed -i 's/__attribute__/\\/\\/__attribute__/g' gcc/cp/cfns.h
sed -i 's/asm ("" : "=r" (__a) : "0" (__a));/do { } while (0);/g' libitm/config/generic/atomic.h
sed -i '/const char \* libc_name_p (const char \*, unsigned int);/c\
#ifdef __GNUC__\
__inline\
#endif\
static inline const char * libc_name_p (const char *str, unsigned int len)\
{\
return in_word_set(str, len);\
}' gcc/cp/cfns.h
./contrib/download_prerequisites
# === New patch for the cfns.gperf 'gnu_inline' error ===
# This removes the offending inline attribute from the file before compilation
sed -i '101s/inline/\/\/inline/' gcc/cp/cfns.gperf
cd ..
mkdir gcc-4.8.5-build
cd gcc-4.8.5-build
../gcc-4.8.5/configure \
--prefix=$HOME/gcc-4.8.5 \
--enable-languages=c,c++ \
--disable-multilib \
--disable-nls \
--disable-bootstrap \
CXXFLAGS="-std=gnu++11"
make -j$(nproc)
make install
< /code>
Это ошибка показана: < /p>
> In file included from ../../gcc-4.8.5/gcc/cp/except.c:1008:
> cfns.gperf:27:1: error: duplicate ‘inline’ cfns.gperf:29:8: error:
> duplicate ‘inline’ cfns.gperf: In function ‘const char*
> libc_name_p(const char*, unsigned int)’: cfns.gperf:31:10: error:
> ‘in_word_set’ was not declared in this scope cfns.gperf: At global
> scope: cfns.gperf:107:1: error: redefinition of ‘const char*
> libc_name_p(const char*, unsigned int)’ cfns.gperf:29:28: note: ‘const
> char* libc_name_p(const char*, unsigned int)’ previously defined here
> make[2]: *** [Makefile:1059: cp/except.o] Error 1 make[2]: Leaving
> directory '/home/david/Documents/gcc-4.8.5-build/gcc' make[1]: ***
> [Makefile:3988: install-gcc] Error 2 make[1]: Leaving directory
> '/home/david/Documents/gcc-4.8.5-build' make: *** [Makefile:2183:
> install] Error 2
Подробнее здесь: https://stackoverflow.com/questions/797 ... tu-24-04-1
Мобильная версия