From: Jay Mav via ruby-core Date: 2023-12-13T17:50:48-08:00 Subject: [ruby-core:115739] Ruby 3.2.2 Solaris-Sparc Compilation Error in iseq.c --===============2150829455578460260== Content-Type: multipart/alternative; boundary="00000000000011c26c060c6e84a8" --00000000000011c26c060c6e84a8 Content-Type: text/plain; charset="UTF-8" Hello, Building Ruby 3.2.2 on Solaris-Sparc 32-bit with Developer Studio 12.6. Issues: 1) compilation of iseq.c fails due to variable definition in macro OPTION: #define SET_COMPILE_OPTION(o, h, mem) \ { VALUE flag = rb_hash_aref((h), ID2SYM(rb_intern(#mem))); \ if (flag == Qtrue) { (o)->mem = 1; } \ else if (flag == Qfalse) { (o)->mem = 0; } \ } SET_COMPILE_OPTION(option, opt, inline_const_cache); SET_COMPILE_OPTION(option, opt, peephole_optimization); SET_COMPILE_OPTION(option, opt, tailcall_optimization); SET_COMPILE_OPTION(option, opt, specialized_instruction); SET_COMPILE_OPTION(option, opt, operands_unification); SET_COMPILE_OPTION(option, opt, instructions_unification); SET_COMPILE_OPTION(option, opt, stack_caching); SET_COMPILE_OPTION(option, opt, frozen_string_literal); SET_COMPILE_OPTION(option, opt, debug_frozen_string_literal); SET_COMPILE_OPTION(option, opt, coverage_enabled); "iseq.c", line 812: identifier redefined: flag current : unsigned long ... If the definition of flag is moved outside of the macro: VALUE flag; #define SET_COMPILE_OPTION(o, h, mem) \ { flag = rb_hash_aref((h), ID2SYM(rb_intern(#mem))); \ if (flag == Qtrue) { (o)->mem = 1; } \ else if (flag == Qfalse) { (o)->mem = 0; } \ } then iseq.c gets compiled. What's the correct fix for this macro? 2) After fixing the above error, the build progresses but fails in linking miniruby linking miniruby Undefined first referenced symbol in file .L13046 iseq.o It is not clear what .L13046 represents. Can any one please share how this issue can be resolved? Thanks. --00000000000011c26c060c6e84a8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

Building Ruby 3.2.2 on Solaris-Sparc 32-bit = with Developer Studio 12.6.

Issues:
1) compilation of iseq.c fail= s due to variable definition in macro OPTION:
#define SET_COMPILE_OPTION= (o, h, mem) \
=C2=A0 { VALUE flag =3D rb_hash_aref((h), ID2SYM(rb_intern= (#mem))); \
=C2=A0 =C2=A0 =C2=A0 if (flag =3D=3D Qtrue) =C2=A0{ (o)->= mem =3D 1; } \
=C2=A0 =C2=A0 =C2=A0 else if (flag =3D=3D Qfalse) =C2=A0{= (o)->mem =3D 0; } \
=C2=A0 }

=C2=A0 =C2=A0 SET_COMPILE_OPTION= (option, opt, inline_const_cache);
=C2=A0 =C2=A0 SET_COMPILE_OPTION(opti= on, opt, peephole_optimization);
=C2=A0 =C2=A0 SET_COMPILE_OPTION(option= , opt, tailcall_optimization);
=C2=A0 =C2=A0 SET_COMPILE_OPTION(option, = opt, specialized_instruction);
=C2=A0 =C2=A0 SET_COMPILE_OPTION(option, = opt, operands_unification);
=C2=A0 =C2=A0 SET_COMPILE_OPTION(option, opt= , instructions_unification);
=C2=A0 =C2=A0 SET_COMPILE_OPTION(option, op= t, stack_caching);
=C2=A0 =C2=A0 SET_COMPILE_OPTION(option, opt, frozen_= string_literal);
=C2=A0 =C2=A0 SET_COMPILE_OPTION(option, opt, debug_fro= zen_string_literal);
=C2=A0 =C2=A0 SET_COMPILE_OPTION(option, opt, cover= age_enabled);

"iseq.c", line 812: identifier redefined: fl= ag
=C2=A0 =C2=A0 =C2=A0 =C2=A0 current : unsigned long
...

If = the definition of flag is moved outside of the macro:

VALUE flag;#define SET_COMPILE_OPTION(o, h, mem) \
=C2=A0 { flag =3D rb_hash_aref(= (h), ID2SYM(rb_intern(#mem))); \
=C2=A0 =C2=A0 =C2=A0 if (flag =3D=3D Qt= rue) =C2=A0{ (o)->mem =3D 1; } \
=C2=A0 =C2=A0 =C2=A0 else if (flag = =3D=3D Qfalse) =C2=A0{ (o)->mem =3D 0; } \
=C2=A0 }

then iseq.= c gets compiled. What's the correct fix for this macro?

2) After= fixing the above error, the build progresses but fails in linking miniruby=

linking miniruby
Undefined =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 first referenced
=C2=A0symbol = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 in file
.L13046 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 iseq.o
It is not clear what .L13046 represents. Can any one please share how= this issue can be resolved?

Thanks.
--00000000000011c26c060c6e84a8-- --===============2150829455578460260== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/ --===============2150829455578460260==--