Opened 4 months ago

Closed 3 months ago

#70278 closed defect (fixed)

chez-scheme @10.0.0: error: use of unknown builtin '__builtin_add_overflow'

Reported by: barracuda156 Owned by: mohd-akram (Mohamed Akram)
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: yosemite, mavericks, mountainlion, lion, haspatch Cc:
Port: chez-scheme

Description

There are no logs anymore, but I open the issue since I need this port for idris2. It builds and works on my 10.6 ppc, so should be fixable on x86 for sure.

Change History (6)

comment:1 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)

I reran the buildbot builds and the error is:

c/pb.c:122:10: error: use of unknown builtin '__builtin_add_overflow' [-Wimplicit-function-declaration]
    case COMMON_INSTR(pb_bin_op_pb_signal_pb_add_pb_register)
         ^
c/pb.c:51:28: note: expanded from macro 'COMMON_INSTR'
#define COMMON_INSTR(x) x: doi_ ## x(instr); break;
                           ^
<scratch space>:73:1: note: expanded from here
doi_pb_bin_op_pb_signal_pb_add_pb_register
^
c/pb.h:384:4: note: expanded from macro 'doi_pb_bin_op_pb_signal_pb_add_pb_register'
   do_pb_bin_op_pb_signal_pb_add_pb_register(INSTR_drr_dest(instr), INSTR_drr_reg1(instr), INSTR_drr_reg2(instr))
   ^
c/pb.h:390:12: note: expanded from macro 'do_pb_bin_op_pb_signal_pb_add_pb_register'
    flag = __builtin_add_overflow(a, b, &r);                         \
           ^

comment:2 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)

In #60698 we worked around the problem by blacklisting {clang < 800}. It would be better if chez-scheme would only use __builtin_add_overflow if the compiler supports it. At present, they use it if USE_OVERFLOW_INTRINSICS is defined, and they define it for gcc 5 or greater or any version of clang, which is clearly wrong. I filed a bug report with them here: https://github.com/cisco/ChezScheme/issues/845

comment:3 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: snowleopard removed
Summary: chez-scheme fails on 10.10 and earlierchez-scheme @10.0.0: error: use of unknown builtin '__builtin_add_overflow'

The error on Snow Leopard is different; see #70280.

comment:4 in reply to:  2 Changed 4 months ago by barracuda156

Replying to ryandesign:

In #60698 we worked around the problem by blacklisting {clang < 800}. It would be better if chez-scheme would only use __builtin_add_overflow if the compiler supports it. At present, they use it if USE_OVERFLOW_INTRINSICS is defined, and they define it for gcc 5 or greater or any version of clang, which is clearly wrong. I filed a bug report with them here: https://github.com/cisco/ChezScheme/issues/845

Thank you, Ryan!

comment:5 Changed 3 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added

comment:6 Changed 3 months ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In f575f8a3495ba5afbe640a4a3dbb14f3afc44e28/macports-ports (master):

chez-scheme: Only use intrinsics if available

Closes: #70278

Note: See TracTickets for help on using tickets.