Project

General

Profile

Actions

Bug #18442

closed

Make Ruby 3.0.3 on Solaris 10 with "The following command caused the error: cc -D_STDC_C99= "

Added by dklein (Dmitri Klein) over 2 years ago. Updated over 2 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:106851]

Description

make

...

cc: acomp failed for vm.c
*** Error code 2
The following command caused the error:
cc -D_STDC_C99= -g -erroff=E_STATEMENT_NOT_REACHED -erroff=E_INIT_SIGN_EXTEND -erroff=E_INIT_DOES_NOT_FIT -erroff=E_INITIALIZATION_TYPE_MISMATCH -DRUBY_EXPORT -I. -I.ext/include/i386-solaris2.10 -I./include -I. -I./enc/unicode/12.1.0 -D_XOPEN_SOURCE=600 -o vm.o -c vm.c
make: Fatal error: Command failed for target `vm.o'

======

Configuration summary for ruby version 3.0.3

  • Installation prefix: /usr/local
  • exec prefix: ${prefix}
  • arch: i386-solaris2.10
  • site arch: ${arch}
  • RUBY_BASE_NAME: ruby
  • ruby lib prefix: ${libdir}/${RUBY_BASE_NAME}
  • site libraries path: ${rubylibprefix}/${sitearch}
  • vendor path: ${rubylibprefix}/vendor_ruby
  • target OS: solaris2.10
  • compiler: cc -D_STDC_C99=
  • with pthread: yes
  • with coroutine: ucontext
  • enable shared libs: no
  • dynamic library ext: so
  • CFLAGS: ${optflags} ${debugflags} ${warnflags}
  • LDFLAGS: -L.
  • debugflags: -g
  • warnflags: -erroff=E_STATEMENT_NOT_REACHED
    -erroff=E_INIT_SIGN_EXTEND
    -erroff=E_INIT_DOES_NOT_FIT
    -erroff=E_INITIALIZATION_TYPE_MISMATCH
  • strip command: gstrip -S -x
  • install doc: rdoc
  • JIT support: yes
  • man page type: man


Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #18429: Configure ruby-3.0.3 on Solaris 10 Unknown keyword 'URL' in './ruby.tmp.pc'FeedbackActions

Updated by dklein (Dmitri Klein) over 2 years ago

Similar error by using gmake for other Ruby versions :

/usr/include/stdbool.h:42:2: #error "Use of <stdbool.h> is valid only in a c99 compilation environment."
gmake[2]: *** [big2str.o] Error 1 

== Makefile:

CC = gcc -std=gnu99

Updated by dklein (Dmitri Klein) over 2 years ago

Configuration summary for ruby version 3.0.3

   * Installation prefix: /usr/local
   * exec prefix:         ${prefix}
   * arch:                i386-solaris2.10
   * site arch:           ${arch}
   * RUBY_BASE_NAME:      ruby
   * ruby lib prefix:     ${libdir}/${RUBY_BASE_NAME}
   * site libraries path: ${rubylibprefix}/${sitearch}
   * vendor path:         ${rubylibprefix}/vendor_ruby
   * target OS:           solaris2.10
   * compiler:            cc -D_STDC_C99=
   * with pthread:        yes
   * with coroutine:      ucontext
   * enable shared libs:  no
   * dynamic library ext: so
   * CFLAGS:              ${optflags} ${debugflags} ${warnflags}
   * LDFLAGS:             -L. 
   * debugflags:          -g
   * warnflags:           -erroff=E_STATEMENT_NOT_REACHED \
                          -erroff=E_INIT_SIGN_EXTEND \
                          -erroff=E_INIT_DOES_NOT_FIT \
                          -erroff=E_INITIALIZATION_TYPE_MISMATCH
   * strip command:       gstrip -S -x
   * install doc:         rdoc
   * JIT support:         yes
   * man page type:       man

# make
        BASERUBY = echo executable host ruby is required.  use --with-baseruby option.; false
        CC = cc -D_STDC_C99=
        LD = /usr/ccs/bin/ld
        LDSHARED = cc -D_STDC_C99= -G
        CFLAGS =  -g -erroff=E_STATEMENT_NOT_REACHED -erroff=E_INIT_SIGN_EXTEND -erroff=E_INIT_DOES_NOT_FIT -erroff=E_INITIALIZATION_TYPE_MISMATCH 
        XCFLAGS = -DRUBY_EXPORT -I. -I.ext/include/i386-solaris2.10 -I./include -I. -I./enc/unicode/12.1.0
        CPPFLAGS = -D_XOPEN_SOURCE=600   
        DLDFLAGS =  
        SOLIBS = -lz -lpthread -lrt -lrt -lrt -lsocket -ldl -lcrypt -lm
        LANG = 
        LC_ALL = 
        LC_CTYPE = 
        MFLAGS = 
cc: Sun C 5.12 SunOS_i386 2011/11/16
compiling vm.c
....
"vm.c", line 3373: left operand must be modifiable lvalue: op "="
cc: acomp failed for vm.c
*** Error code 2
The following command caused the error:
cc -D_STDC_C99=  -g -erroff=E_STATEMENT_NOT_REACHED -erroff=E_INIT_SIGN_EXTEND -erroff=E_INIT_DOES_NOT_FIT -erroff=E_INITIALIZATION_TYPE_MISMATCH  -DRUBY_EXPORT -I. -I.ext/include/i386-solaris2.10 -I./include -I. -I./enc/unicode/12.1.0 -D_XOPEN_SOURCE=600    -o vm.o -c vm.c
make: Fatal error: Command failed for target `vm.o'
# 

Updated by dklein (Dmitri Klein) over 2 years ago

Enabling c99 (Enable ISO C99 features) didn't help:

CC=/opt/SUNWspro/bin/cc CFLAGS="-xc99=all" ./configure

make
...
"vm.c", line 3373: left operand must be modifiable lvalue: op "="
cc: acomp failed for vm.c
*** Error code 2
The following command caused the error:
/opt/SUNWspro/bin/cc -xc99=all  -DRUBY_EXPORT -I. -I.ext/include/i386-solaris2.10 -I./include -I. -I./enc/unicode/12.1.0 -D_XOPEN_SOURCE=600    -o vm.o -c vm.c
make: Fatal error: Command failed for target `vm.o'
# 

Updated by dklein (Dmitri Klein) over 2 years ago

/usr/local/gcc4/bin/gcc --version
gcc (GCC) 4.5.1

gmake
    BASERUBY = echo executable host ruby is required.  use --with-baseruby option.; false
    CC = /usr/local/gcc4/bin/gcc -std=gnu99
    LD = /usr/ccs/bin/ld
    LDSHARED = /usr/local/gcc4/bin/gcc -std=gnu99 -G
    CFLAGS =  -g -erroff=E_STATEMENT_NOT_REACHED -erroff=E_INIT_SIGN_EXTEND -erroff=E_INIT_DOES_NOT_FIT -erroff=E_INITIALIZATION_TYPE_MISMATCH  
    XCFLAGS = -DRUBY_EXPORT -I. -I.ext/include/i386-solaris2.10 -I./include -I. -I./enc/unicode/12.1.0
    CPPFLAGS = -D_XOPEN_SOURCE=600   
    DLDFLAGS =  
    SOLIBS = -lz -lpthread -lrt -lrt -lrt -lsocket -ldl -lcrypt -lm 
    LANG = 
    LC_ALL = 
    LC_CTYPE = 
    MFLAGS = 
gcc: '-V' must come at the start of the command line
gmake: [showflags] Error 1 (ignored)
compiling ./main.c
Assembler: main.c
"/var/tmp//cccYLZfp.s", line 10 : Illegal mnemonic
Near line: " .cfi_sections .debug_frame"
...
"/var/tmp//cccYLZfp.s", line 56 : Syntax error
Near line: " .cfi_def_cfa_offset 8"
Too many errors - Goodbye
gmake: *** [main.o] Error 1

Updated by dklein (Dmitri Klein) over 2 years ago

Using "make" generates similar error message:

# make
        BASERUBY = echo executable host ruby is required.  use --with-baseruby option.; false
        CC = /usr/local/gcc4/bin/gcc
        LD = /usr/ccs/bin/ld
        LDSHARED = /usr/local/gcc4/bin/gcc -G
        CFLAGS =  -g -erroff=E_STATEMENT_NOT_REACHED -erroff=E_INIT_SIGN_EXTEND -erroff=E_INIT_DOES_NOT_FIT -erroff=E_INITIALIZATION_TYPE_MISMATCH 
        XCFLAGS = -DRUBY_EXPORT -I. -I.ext/include/i386-solaris2.10 -I./include -I. -I./enc/unicode/12.1.0
        CPPFLAGS = -D_XOPEN_SOURCE=600   
        DLDFLAGS =  
        SOLIBS = -lz -lpthread -lrt -lrt -lrt -lsocket -ldl -lcrypt -lm
        LANG = 
        LC_ALL = 
        LC_CTYPE = 
        MFLAGS = 
gcc (GCC) 4.5.1
Copyright (C) 2010 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.

compiling vm.c
In file included from /usr/include/stdio.h:21:0,
                 from ./include/ruby/defines.h:16,
                 from ./include/ruby/ruby.h:23,
                 from eval_intern.h:4,
                 from vm.c:13:
/usr/local/gcc4/lib/gcc/i386-pc-solaris2.10/4.5.1/include-fixed/sys/feature_tests.h:345:2: error: #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications    require the use of c99"
In file included from vm.c:352:0:
vm_insnhelper.c: In function 'vm_push_frame':
vm_insnhelper.c:372:5: error: 'for' loop initial declarations are only allowed in C99 mode
vm_insnhelper.c:372:5: note: use option -std=c99 or -std=gnu99 to compile your code
vm_insnhelper.c: In function 'vm_search_cc':
vm_insnhelper.c:1652:17: error: 'for' loop initial declarations are only allowed in C99 mode
In file included from vm.c:352:0:
vm_insnhelper.c: In function 'vm_callee_setup_arg':
vm_insnhelper.c:2438:13: error: 'for' loop initial declarations are only allowed in C99 mode
In file included from vm.c:352:0:
vm_insnhelper.c: In function 'vm_invoke_builtin_delegate':
vm_insnhelper.c:5598:9: error: 'for' loop initial declarations are only allowed in C99 mode
In file included from vm.c:358:0:
vm_method.c: In function 'vm_ccs_dump_i':
vm_method.c:32:5: error: 'for' loop initial declarations are only allowed in C99 mode
vm.c: In function 'env_copy':
vm.c:1008:9: error: 'for' loop initial declarations are only allowed in C99 mode
vm.c:1011:13: error: 'for' loop initial declarations are only allowed in C99 mode
*** Error code 1
The following command caused the error:
/usr/local/gcc4/bin/gcc  -g -erroff=E_STATEMENT_NOT_REACHED -erroff=E_INIT_SIGN_EXTEND -erroff=E_INIT_DOES_NOT_FIT -erroff=E_INITIALIZATION_TYPE_MISMATCH  -DRUBY_EXPORT -I. -I.ext/include/i386-solaris2.10 -I./include -I. -I./enc/unicode/12.1.0 -D_XOPEN_SOURCE=600    -o vm.o -c vm.c
make: Fatal error: Command failed for target `vm.o'
# 

Updated by dklein (Dmitri Klein) over 2 years ago

Using /usr/local/gcc4/bin/gcc -std=c99 in Makefile didn't fix the problem:

.....
vm.c:2549:2: error: expected statement before ')' token
vm.c:2549:2: error: expected statement before ')' token
*** Error code 1
The following command caused the error:
/usr/local/gcc4/bin/gcc -std=c99  -g -erroff=E_STATEMENT_NOT_REACHED -erroff=E_INIT_SIGN_EXTEND -erroff=E_INIT_DOES_NOT_FIT -erroff=E_INITIALIZATION_TYPE_MISMATCH  -DRUBY_EXPORT -I. -I.ext/include/i386-solaris2.10 -I./include -I. -I./enc/unicode/12.1.0 -D_XOPEN_SOURCE=600    -o vm.o -c vm.c
make: Fatal error: Command failed for target `vm.o'
# 
Actions #7

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Is duplicate of Bug #18429: Configure ruby-3.0.3 on Solaris 10 Unknown keyword 'URL' in './ruby.tmp.pc' added

Updated by hsbt (Hiroshi SHIBATA) over 2 years ago

  • Status changed from Open to Closed

Can you use a single ticket for this failure? Please use https://bugs.ruby-lang.org/issues/18429

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0