Меnu:


El emacs23 es 'la versión de emacs de la velocidad de la luz'. Es la versión mas veloz al editar código en lenguaje C. Ninguna versión posterior de Emacs es capaz de vencer a emacs23 editando código en lenguaje C. Seguirá siendo correcta esa afirmación una vez que instalemos y probemos gccemacs?.

instalar gccemacs en archlinux-ARM-32bits

La distro que usamos es Archlinux y sus retoños (archlinux-ARM, arch32). Donde fue mas fácil y sencillo instalar y correr gccemacs fue en archlinux-x86-64. En arch32 cuya arquitectura es i686 también fue fácil, una vez compilado el paquete libgccjit, claro que estamos hablando del año 2020. En el 2021 ya libgccjit esta compilado por defecto en arch32.

También en el 2020 intentamos compilar gccemacs en archlinux-ARM también conocido como alarm. Con mucha dificultad logramos compilar libgccjit.

--8<---------------cut here---------------start------------->8---
Name            : libgccjit
Version         : 10.2.0-2
Description     : Just-In-Time Compilation using GCC.
Architecture    : armv7h
URL             : https://gcc.gnu.org/wiki/JIT
Licenses        : GPL3
Groups          : None
Provides        : None
Depends On      : glibc  libmpc  zlib  gmp  mpfr  libmpc  gcc-libs=10.2.0
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 18.60 MiB
Packager        : anonymous2 <anonymous@anonimous.org>
Build Date      : Fri 09 Oct 2020 07:21:05 PM UTC
Install Date    : Sat 10 Oct 2020 02:55:49 PM UTC
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None
--8<---------------cut here---------------end--------------->8---

Pero cuando intentamos compilar gccemacs en aquel momento, nos genero el siguiente error.

--8<---------------cut here---------------start------------->8---
checking for gcc_jit_context_acquire in -lgccjit... yes
checking for libgccjit.h... yes
configure: error: The installed libgccjit failed to compile and run a test program using
the libgccjit library; see config.log for the details of the failure.
The test program can be found here:
<https://gcc.gnu.org/onlinedocs/jit/intro/tutorial01.html>.
You can try compiling it yourself to investigate the issues.
Please report the issue to your distribution if libgccjit was installed
through that.
You can find the instructions on how to compile and install libgccjit from
source on this site:
<https://gcc.gnu.org/wiki/JIT>.
==> ERROR: A failure occurred in build().
    Aborting...
--8<---------------cut here---------------end--------------->8---

Para ese momento. Todo ello quedo allí. compilar libgccjit fue una ardua tarea. Hace poco en la lista de correos de Emacs, hubo un correo acerca de la creación de la rama emacs-28. También hace poco se anuncio en Phoronix que fue liberada la versión 11 de gcc también conocido como gcc11. Así que era momento de ver si era mucho mas sencillo compilar libgccjit para gcc11 de lo que fue para gcc10. Lamentablemente últimamente los paquetes de archlinux-ARM 32 bits están bastante desfasados, pero como los encargados del proyecto también tienen carencia de horas hombre, no se puede pedir mas. Tan solo dar las gracias a las personas que donar su tiempo para sacar el proyecto adelante.

Para compilar gcc11. Se necesita compilar previamente glibc y binutils. Intentamos cross-compilar gcc1 pero al instalarlo dicha versión no podía generar ejecutables. Luego intentamos compilarlo directamente en la 'orange pi plus 2e'. Comenzamos con glibc, compilar glibc fue relativamente fácil, solo hubo que hacer una modificación menor en el PKGBUILD.

El siguiente paso era intentar compilar binutils. Nos dio un error de compilación. Del cual pondremos el ultimo extracto debajo:

--8<---------------cut here---------------start------------->8---
/usr/include/c++/10.2.0/bits/stl_algo.h:1886:25: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, false>*, std::vector<gold::Output_reloc<9, true, 64, false>, std::allocator<gold::Output_reloc<9, true, 64, false> > > >’ changed in GCC 7.1
 1886 |    std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
      |    ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_algo.h:1891:23: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, false>*, std::vector<gold::Output_reloc<9, true, 64, false>, std::allocator<gold::Output_reloc<9, true, 64, false> > > >’ changed in GCC 7.1
 1891 |  std::__insertion_sort(__first, __last, __comp);
      |  ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_algo.h: In function ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, true>*, std::vector<gold::Output_reloc<9, true, 64, true>, std::allocator<gold::Output_reloc<9, true, 64, true> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<gold::Output_data_reloc_base<9, true, 64, true>::Sort_relocs_comparison>]’:
/usr/include/c++/10.2.0/bits/stl_algo.h:1662:5: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, true>*, std::vector<gold::Output_reloc<9, true, 64, true>, std::allocator<gold::Output_reloc<9, true, 64, true> > > >’ changed in GCC 7.1
 1662 |     __heap_select(_RandomAccessIterator __first,
      |     ^~~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_algo.h:1662:5: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, true>*, std::vector<gold::Output_reloc<9, true, 64, true>, std::allocator<gold::Output_reloc<9, true, 64, true> > > >’ changed in GCC 7.1
/usr/include/c++/10.2.0/bits/stl_algo.h:1662:5: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, true>*, std::vector<gold::Output_reloc<9, true, 64, true>, std::allocator<gold::Output_reloc<9, true, 64, true> > > >’ changed in GCC 7.1
/usr/include/c++/10.2.0/bits/stl_algo.h:1662:5: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, true>*, std::vector<gold::Output_reloc<9, true, 64, true>, std::allocator<gold::Output_reloc<9, true, 64, true> > > >’ changed in GCC 7.1
/usr/include/c++/10.2.0/bits/stl_algo.h: In function ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, true>*, std::vector<gold::Output_reloc<9, true, 64, true>, std::allocator<gold::Output_reloc<9, true, 64, true> > > >; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<gold::Output_data_reloc_base<9, true, 64, true>::Sort_relocs_comparison>]’:
/usr/include/c++/10.2.0/bits/stl_algo.h:1945:5: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, true>*, std::vector<gold::Output_reloc<9, true, 64, true>, std::allocator<gold::Output_reloc<9, true, 64, true> > > >’ changed in GCC 7.1
 1945 |     __introsort_loop(_RandomAccessIterator __first,
      |     ^~~~~~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_algo.h:1945:5: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, true>*, std::vector<gold::Output_reloc<9, true, 64, true>, std::allocator<gold::Output_reloc<9, true, 64, true> > > >’ changed in GCC 7.1
/usr/include/c++/10.2.0/bits/stl_algo.h:1959:25: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, true>*, std::vector<gold::Output_reloc<9, true, 64, true>, std::allocator<gold::Output_reloc<9, true, 64, true> > > >’ changed in GCC 7.1
 1959 |    std::__introsort_loop(__cut, __last, __depth_limit, __comp);
      |    ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_algo.h:1937:25: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, true>*, std::vector<gold::Output_reloc<9, true, 64, true>, std::allocator<gold::Output_reloc<9, true, 64, true> > > >’ changed in GCC 7.1
 1937 |       std::__heap_select(__first, __middle, __last, __comp);
      |       ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_algo.h: In member function ‘void {anonymous}::Mips_output_data_reloc<sh_type, dynamic, size, big_endian>::do_write(gold::Output_file*) [with int sh_type = 9; bool dynamic = true; int size = 64; bool big_endian = true]’:
/usr/include/c++/10.2.0/bits/stl_algo.h:1974:25: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, true>*, std::vector<gold::Output_reloc<9, true, 64, true>, std::allocator<gold::Output_reloc<9, true, 64, true> > > >’ changed in GCC 7.1
 1974 |    std::__introsort_loop(__first, __last,
      |    ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
 1975 |     std::__lg(__last - __first) * 2,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1976 |     __comp);
      |     ~~~~~~~
/usr/include/c++/10.2.0/bits/stl_algo.h:1886:25: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, true>*, std::vector<gold::Output_reloc<9, true, 64, true>, std::allocator<gold::Output_reloc<9, true, 64, true> > > >’ changed in GCC 7.1
 1886 |    std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
      |    ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_algo.h:1891:23: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<9, true, 64, true>*, std::vector<gold::Output_reloc<9, true, 64, true>, std::allocator<gold::Output_reloc<9, true, 64, true> > > >’ changed in GCC 7.1
 1891 |  std::__insertion_sort(__first, __last, __comp);
      |  ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
mv -f .deps/mips.Tpo .deps/mips.Po
/usr/include/c++/10.2.0/bits/stl_vector.h: In member function ‘void {anonymous}::Target_aarch64<size, big_endian>::scan_relocs(gold::Symbol_table*, gold::Layout*, gold::Sized_relobj_file<size, big_endian>*, unsigned int, unsigned int, const unsigned char*, size_t, gold::Output_section*, bool, size_t, const unsigned char*) [with int size = 64; bool big_endian = false]’:
/usr/include/c++/10.2.0/bits/stl_vector.h:1198:21: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<4, true, 64, false>*, std::vector<gold::Output_reloc<4, true, 64, false>, std::allocator<gold::Output_reloc<4, true, 64, false> > > >’ changed in GCC 7.1
 1198 |    _M_realloc_insert(end(), __x);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_vector.h:1198:21: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<4, true, 64, false>*, std::vector<gold::Output_reloc<4, true, 64, false>, std::allocator<gold::Output_reloc<4, true, 64, false> > > >’ changed in GCC 7.1
 1198 |    _M_realloc_insert(end(), __x);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_vector.h:1198:21: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<4, true, 64, false>*, std::vector<gold::Output_reloc<4, true, 64, false>, std::allocator<gold::Output_reloc<4, true, 64, false> > > >’ changed in GCC 7.1
 1198 |    _M_realloc_insert(end(), __x);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_vector.h:1198:21: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<4, true, 64, false>*, std::vector<gold::Output_reloc<4, true, 64, false>, std::allocator<gold::Output_reloc<4, true, 64, false> > > >’ changed in GCC 7.1
 1198 |    _M_realloc_insert(end(), __x);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_vector.h: In member function ‘void {anonymous}::Target_aarch64<size, big_endian>::scan_relocs(gold::Symbol_table*, gold::Layout*, gold::Sized_relobj_file<size, big_endian>*, unsigned int, unsigned int, const unsigned char*, size_t, gold::Output_section*, bool, size_t, const unsigned char*) [with int size = 64; bool big_endian = true]’:
/usr/include/c++/10.2.0/bits/stl_vector.h:1198:21: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<4, true, 64, true>*, std::vector<gold::Output_reloc<4, true, 64, true>, std::allocator<gold::Output_reloc<4, true, 64, true> > > >’ changed in GCC 7.1
 1198 |    _M_realloc_insert(end(), __x);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_vector.h:1198:21: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<4, true, 64, true>*, std::vector<gold::Output_reloc<4, true, 64, true>, std::allocator<gold::Output_reloc<4, true, 64, true> > > >’ changed in GCC 7.1
 1198 |    _M_realloc_insert(end(), __x);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_vector.h:1198:21: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<4, true, 64, true>*, std::vector<gold::Output_reloc<4, true, 64, true>, std::allocator<gold::Output_reloc<4, true, 64, true> > > >’ changed in GCC 7.1
 1198 |    _M_realloc_insert(end(), __x);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/stl_vector.h:1198:21: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<gold::Output_reloc<4, true, 64, true>*, std::vector<gold::Output_reloc<4, true, 64, true>, std::allocator<gold::Output_reloc<4, true, 64, true> > > >’ changed in GCC 7.1
 1198 |    _M_realloc_insert(end(), __x);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
mv -f .deps/aarch64.Tpo .deps/aarch64.Po
make[4]: Leaving directory '/home/user/abs/binutils/src/binutils-build/gold'
make[3]: *** [Makefile:1157: all-recursive] Error 1
make[3]: Leaving directory '/home/user/abs/binutils/src/binutils-build/gold'
make[2]: *** [Makefile:897: all] Error 2
make[2]: Leaving directory '/home/user/abs/binutils/src/binutils-build/gold'
make[1]: *** [Makefile:6120: all-gold] Error 2
make[1]: Leaving directory '/home/user/abs/binutils/src/binutils-build'
make: *** [Makefile:854: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
--8<---------------cut here---------------end--------------->8---

Si tienen algún tip que compartir acerca de este error. Nos envían un correo a la dirección de correo 'blogpost en kipuamutay punto com'.

Sin embargo. Esto nos dio la idea de comparar el PKGBUILD de archlinux-x86-64 con el PKGBUILD de alarm. Al ver las diferencias pudimos notar con claridad los cambios que debíamos hacer en el PKGBUILD de libgccjit. Aplicamos los cambios y compilamos el paquete. Después de mas o menos una hora la compilación termino. Todo bien esta aquí.

Acabábamos de compilar libgccjit para gcc-10.2. Funcionaria?. Estábamos a punto de comprobarlo. Lanzamos la compilación de gccemacs. NO nos dio el error que nos había dado un año antes después de tres horas de compilación. Instalamos el paquete y lanzamos gccemacs. Esta funcionando perfectamente ya por dos días.

Estas son las diferencias de los cambios que hay que hacer en el PKGBUILD:

--8<---------------cut here---------------start------------->8---
diff -u /home/user/abs/libgccjit/PKGBUILD.as.it.was /home/user/abs/libgccjit/PKGBUILD
--- /home/user/abs/libgccjit/PKGBUILD.as.it.was 2021-11-08 23:57:13.249050172 +0000
+++ /home/user/abs/libgccjit/PKGBUILD   2021-11-09 00:22:01.793073903 +0000
@@ -4,7 +4,7 @@
 # Contributor: Jashandeep Sohi <jashandeep.s.sohi@gmail.com>

 pkgname=libgccjit
-pkgver=11.1.0
+pkgver=10.2.0
 pkgrel=1
 pkgdesc='Just-In-Time Compilation using GCC.'
 arch=(x86_64)
@@ -21,6 +21,11 @@
               D3A93CAD751C2AF4F8C7AD516C35B99309B5FA62) # Jakub Jelinek <jakub@redhat.com>
 sha256sums=('4c4a6fb8a8396059241c2e674b85b351c26a5d678274007f076957afa1cc9ddf'
             'SKIP')
+# ALARM: Specify build host types, triplet patch
+[[ $CARCH == "arm" ]] && CONFIGFLAG="--host=armv5tel-unknown-linux-gnueabi --build=armv5tel-unknown-linux-gnueabi --with-arch=armv5te --with-float=soft"
+[[ $CARCH == "armv6h" ]] && CONFIGFLAG="--host=armv6l-unknown-linux-gnueabihf --build=armv6l-unknown-linux-gnueabihf --with-arch=armv6 --with-float=hard --with-fpu=vfp"
+[[ $CARCH == "armv7h" ]] && CONFIGFLAG="--host=armv7l-unknown-linux-gnueabihf --build=armv7l-unknown-linux-gnueabihf --with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16"
+[[ $CARCH == "aarch64" ]] && CONFIGFLAG="--host=aarch64-unknown-linux-gnu --build=aarch64-unknown-linux-gnu --with-arch=armv8-a --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419"

 prepare() {
  cd "$srcdir/gcc-$pkgver"
@@ -29,7 +34,7 @@
  sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in

  # Arch Linux installs x86_64 libraries /lib
- sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
+ [[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64

  # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
  sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
@@ -52,7 +57,6 @@
      --with-linker-hash-style=gnu \
      --with-system-zlib \
      --enable-__cxa_atexit \
-     --enable-cet=auto \
      --enable-checking=release \
      --enable-clocale=gnu \
      --enable-default-pie \
@@ -62,7 +66,6 @@
      --enable-install-libiberty \
      --enable-linker-build-id \
      --enable-lto \
-     --enable-multilib \
      --enable-plugin \
      --enable-shared \
      --enable-host-shared \
@@ -81,7 +84,8 @@
      --disable-libsanitizer \
      --disable-libstdcxx-pch \
      --disable-libunwind-exceptions \
-     --disable-werror
+     --disable-werror \
+     $CONFIGFLAG

  make
 }

Diff finished.  Fri Nov 12 01:10:16 2021
--8<---------------cut here---------------end--------------->8---

También les compartiremos. Las opciones de compilación del gccemacs:

--8<---------------cut here---------------start------------->8---
"--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man
--with-gameuser=:games --with-sound=alsa --with-modules --without-gconf --without-gsettings
--with-wide-int --with-harfbuzz --with-json=yes --with-native-compilation
--enable-link-time-optimization --with-native-compilation --with-x-toolkit=lucid --with-xft
--with-xaw3d --without-compress-install '--program-transform-name=s/\\([ec]tags\\)/\\1.emacs/'
'CFLAGS= -flto -fuse-linker-plugin' CPPFLAGS=
LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
--8<---------------cut here---------------end--------------->8---

Algunas imágenes:

Es mas veloz gccemacs que emacs23. Aun no lo sabremos necesitamos reinstalar emacs23 y hacer las pruebas nuevamente. Pero nos detendremos aquí en este articulo y haremos la comparación en otro articulo posterior.

Ha hacer el bien y a permanecer sanos.

Last change: 14.11.2021 01:23

blog comments powered by Disqus