You are not logged in.

#1 2023-06-01 07:25:55

arch@pfeifer-syscon.de
Member
Registered: 2023-05-30
Posts: 4

gcc build additional language modula

I'am trying to get the modula2 compiler included in gcc to work.
As a start i used the gcc PKBUILD as my intention was to match the version of the build, and want to avoid a complete rebuild (as my machine is a bit aged and it takes already a day or so).
The used function in PKGBUILD looks like this and of course the changed language selection ( --enable-languages=m2 ):

package_gcc-m2() {
  pkgdesc='Modula2 front-end for GCC'
  depends=("gcc=$pkgver-$pkgrel" libm2.so)
  provides=("gm2" $pkgname-multilib)
  replaces=($pkgname-multilib)
  conflicts=(gm2)

  cd gcc-build
  make -C $CHOST/libgm2 DESTDIR="$pkgdir" install-exec-am
  make -C $CHOST/32/libgm2 DESTDIR="$pkgdir" install-exec-am
  #make DESTDIR="$pkgdir" install-gm2tools
  make -C gcc DESTDIR="$pkgdir" m2.install-{common,man,info,plugin}

  rm -f "$pkgdir"/usr/lib{,32}/libm2.so*
  install -Dm755 gcc/gm2 "$pkgdir/${_libdir}/gm2"

  # Install Runtime Library Exception
  install -d "$pkgdir/usr/share/licenses/$pkgname/"
  ln -s /usr/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION \
    "$pkgdir/usr/share/licenses/$pkgname/"
}

When trying to compile i get this message:

> gm2 -v -flibs=pim,iso -g hello.mod -o hello -g hello.mod
Driving: gm2 -v -g hello.mod -o hello -g hello.mod -fm2-pathname=- -fm2-pathnameI. -fgen-module-list=- -fscaffold-dynamic -fscaffold-main -flibs=m2pim,m2iso -fplugin=m2rte -l m2pim -l m2iso -l stdc++ -l m -l pthread -shared-libgcc
new argc = 20, added_libraries = 5
Using built-in specs.
COLLECT_GCC=gm2
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/13.1.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/rpf/build/gcc_pack/src/gcc/configure --enable-languages=m2 --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=no --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror : (reconfigured) /home/rpf/build/gcc_pack/src/gcc/configure --enable-languages=m2 --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=no --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.1.1 20230429 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-g' '-o' 'hello' '-g' '-fm2-pathname=-' '-fm2-pathnameI.' '-fgen-module-list=-' '-fscaffold-dynamic' '-fscaffold-main' '-flibs=m2pim,m2iso' '-fplugin=m2rte' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'hello-'
 /usr/lib/gcc/x86_64-pc-linux-gnu/13.1.1/cc1gm2 -v -iplugindir=/usr/lib/gcc/x86_64-pc-linux-gnu/13.1.1/plugin -quiet -dumpdir hello- -dumpbase hello.mod -dumpbase-ext .mod -mtune=generic -march=x86-64 -g -g -version -fm2-pathname=- -fm2-pathnameI. -fgen-module-list=- -fscaffold-dynamic -fscaffold-main -flibs=m2pim,m2iso -fplugin=m2rte -fm2-pathname=- -fm2-pathnameI. hello.mod -o /tmp/cc5I1Fy9.s
incorrect GCC version (13.1.1) this plugin was built for GCC version 13.1.1
cc1gm2: error: failed to initialize plugin /usr/lib/gcc/x86_64-pc-linux-gnu/13.1.1/plugin/m2rte.so
GNU Modula-2 (GCC) version 13.1.1 20230429 (x86_64-pc-linux-gnu)
	compiled by GNU C version 13.1.1 20230429, GMP version 6.2.1, MPFR version 4.2.0-p9, MPC version 1.3.1, isl version isl-0.26-GMP

Obviously 13.1.1 is not compatible with 13.1.1 ....
Is there a way to build additional languages compatible with the existing installation?
Thanks for anyone that can shed some light on this.

Offline

#2 2023-06-01 21:14:34

OpusOne
Member
Registered: 2023-05-31
Posts: 83

Re: gcc build additional language modula

Having a look at how gcc-ada is packaged could be a good idea: https://archlinux.org/packages/core/x86_64/gcc-ada/

Offline

#3 2023-06-02 07:26:37

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: gcc build additional language modula

Funny, I tried the same, but with a different approach. I took the PKGBUILD for the whole compiler collection (@OpusOne, the gcc-ada PKGBUILD is the one the OP is already using) and it failed in building ada.

arch@pfeifer-syscon.de, I guess you will at least need to build the  C++ backend, probably also the C backend.

Offline

#4 2023-06-02 07:36:06

arch@pfeifer-syscon.de
Member
Registered: 2023-05-30
Posts: 4

Re: gcc build additional language modula

Ok thanks, this is what i tried to avoid. As replacing the other parts of gcc looked unwise with the errors logged while testing,  but i now i start to believe they are "expected". So then your build was successful ?

Offline

#5 2023-06-02 08:04:59

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: gcc build additional language modula

No, it was the next thing I wanted to try. I have a build for an older version 13.0.0_r197703, but there was also fortran and objc enabled. I guess my computer is even older than yours, and the build took more than a day or so.

Offline

#6 2023-06-02 08:50:45

arch@pfeifer-syscon.de
Member
Registered: 2023-05-30
Posts: 4

Re: gcc build additional language modula

Stefan Husmann wrote:

No, it was the next thing I wanted to try. I have a build for an older version 13.0.0_r197703, but there was also fortran and objc enabled. I guess my computer is even older than yours, and the build took more than a day or so.

@Maintainer of gcc pls include modula, as building it with the whole suite just adds a little bit of overhead, otherwise it's worksome.

Offline

#7 2023-06-04 02:29:13

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,396
Website

Re: gcc build additional language modula

arch@pfeifer-syscon.de wrote:
Stefan Husmann wrote:

No, it was the next thing I wanted to try. I have a build for an older version 13.0.0_r197703, but there was also fortran and objc enabled. I guess my computer is even older than yours, and the build took more than a day or so.

@Maintainer of gcc pls include modula, as building it with the whole suite just adds a little bit of overhead, otherwise it's worksome.

There is a place for feature requests.  This is not it...

Offline

#8 2023-06-04 03:59:09

OpusOne
Member
Registered: 2023-05-31
Posts: 83

Re: gcc build additional language modula

Allan wrote:
arch@pfeifer-syscon.de wrote:
Stefan Husmann wrote:

No, it was the next thing I wanted to try. I have a build for an older version 13.0.0_r197703, but there was also fortran and objc enabled. I guess my computer is even older than yours, and the build took more than a day or so.

@Maintainer of gcc pls include modula, as building it with the whole suite just adds a little bit of overhead, otherwise it's worksome.

There is a place for feature requests.  This is not it...

Since  AUR PKGBUILD Requests is part of the section title, I do not find the OP's query completely out of place.
But, while I've been using Arch for years, I'm new to this forum, so I'm still not very familiar with it.

That said, to the OP: one issue to be aware of with the Modula-2 front-end is that it has issues that prevent it from properly building on some platforms. There are bug reports that have been assigned about that, so a future release of GCC should fix them.
Meanwhile, providing a PKGBUILD that is sure to work on various architectures  for GCC 13.1 is not going to work.
It is building ok on x86_64 though - which you may assume is good enough, but for now the maintainer would have to pretty much restrict gcc-m2 to this arch. Just so you know.

Offline

#9 2023-06-04 05:34:50

arch@pfeifer-syscon.de
Member
Registered: 2023-05-30
Posts: 4

Re: gcc build additional language modula

Allan wrote:
arch@pfeifer-syscon.de wrote:
Stefan Husmann wrote:

No, it was the next thing I wanted to try. I have a build for an older version 13.0.0_r197703, but there was also fortran and objc enabled. I guess my computer is even older than yours, and the build took more than a day or so.

@Maintainer of gcc pls include modula, as building it with the whole suite just adds a little bit of overhead, otherwise it's worksome.

There is a place for feature requests.  This is not it...

Thanks, i didn't think of it when posting.

Offline

#10 2023-08-04 10:57:32

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: gcc build additional language modula

Offline

Board footer

Powered by FluxBB