gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compilation fails with -v flag when combined with -pipe


From: Brian Callahan
Subject: Compilation fails with -v flag when combined with -pipe
Date: Wed, 07 Jun 2023 17:16:29 +0000

Hi Gaius --

I have encountered a strange problem with gm2. When I compile with the -v flag 
and -pipe is also used, gm2 fails to compile programs. With -v removed (or 
-pipe removed), it works just fine.

I am on OpenBSD/amd64:
/home/brian $ uname -a
OpenBSD hp.my.domain 7.3 GENERIC.MP#1214 amd64

I am using:
/home/brian $ gm2 --version
gm2 (GCC) 14.0.0 20230604 (experimental)
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Git commit:
/home/brian/gcc/gcc $ git rev-parse HEAD
a96ba6b958a00ad59c43cae10be65b263b5d0d2d

I have this simple M2 program:
/home/brian/m2 $ cat hello.mod
MODULE hello;

FROM StrIO IMPORT WriteString, WriteLn;

BEGIN
  WriteString('Hello world from M2!');
  WriteLn
END hello.

If I try to compile with program with `gm2 -v -O2 -pipe -o hello hello.mod 
-Wl,-rpath=/usr/local/gnu/lib` I get this error:
--8<--
Driving: gm2 -v -O2 -pipe -o hello hello.mod -Wl,-rpath=/usr/local/gnu/lib 
-fm2-pathname=- -fm2-pathnameI. -fgen-module-list=- -fscaffold-dynamic -fscaff  
  old-main -flibs=m2cor,m2log,m2pim,m2iso -fplugin=m2rte -l m2cor -l m2log -l 
m2pim -l m2iso -l stdc++ -l m -l pthread
new argc = 21, added_libraries = 7
Using built-in specs.
COLLECT_GCC=gm2
COLLECT_LTO_WRAPPER=/usr/local/gnu/libexec/gcc/x86_64-unknown-openbsd7.3/14.0.0/lto-wrapper
Target: x86_64-unknown-openbsd7.3
Configured with: ../gcc/configure --verbose 
--enable-languages=c,c++,d,fortran,lto,m2,objc,obj-c++,rust --enable-libssp 
--enable-threads=posix --enable-w    char_t --disable-libstdcxx-pch 
--enable-default-ssp --enable-default-pie --enable-cpp 
--with-as=/usr/local/gnu/bin/as --with-ld=/usr/bin/ld --enable-link    
er-build-id --prefix=/usr/local/gnu --with-local-prefix=/usr/local/gnu 
--disable-tls --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20230604 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-O2' '-pipe' '-o' 'hello' '-fm2-pathname=-' 
'-fm2-pathnameI.' '-fgen-module-list=-' '-fscaffold-dynamic' '-fscaffold-main' 
'-fl    ibs=m2cor,m2log,m2pim,m2iso' '-fplugin=m2rte' '-mtune=generic' 
'-march=x86-64'
 /usr/local/gnu/libexec/gcc/x86_64-unknown-openbsd7.3/14.0.0/cc1gm2 -v 
-iplugindir=/usr/local/gnu/lib/gcc/x86_64-unknown-openbsd7.3/14.0.0/plugin 
-quiet     -dumpbase hello.mod -dumpbase-ext .mod -mtune=generic -march=x86-64 
-O2 -version -fm2-pathname=- -fm2-pathnameI. -fgen-module-list=- 
-fscaffold-dynamic -    fscaffold-main -flibs=m2cor,m2log,m2pim,m2iso 
-fplugin=m2rte -fm2-pathname=- -fm2-pathnameI. hello.mod -o - |
 /usr/local/gnu/bin/as -v -o /tmp//cceXRr5c.o -
GNU Modula-2 (GCC) version 14.0.0 20230604 (experimental) 
(x86_64-unknown-openbsd7.3)
        compiled by GNU C version 14.0.0 20230604 (experimental), GMP version 
6.2.1, MPFR version 4.2.0, MPC version 1.3.1, isl version isl-0.25-GMP
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Versions of loaded plugins:
 m2rte: Unknown version.
GNU assembler version 2.40.50 (x86_64-unknown-openbsd7.3) using BFD version 
(GNU Binutils) 2.40.50.20230604
{standard input}: Assembler messages:
{standard input}:1: Error: no such instruction: `hello.mod'
-->8--

If I try to compile with `gm2 -O2 -pipe -o hello hello.mod 
-Wl,-rpath=/usr/local/gnu/lib` it works fine and I get a working executable. If 
I try to compile with `gm2 -O2 -v -o hello hello.mod 
-Wl,-rpath=/usr/local/gnu/lib` it also works fine. It's the combination of -v 
and -pipe that is causing the problem.

Thanks.

~Brian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]