[CLN-list] Error building cln on M1 Mac

Ron Garret ron at flownet.com
Sun Mar 5 17:34:15 CET 2023



> On Mar 5, 2023, at 6:28 AM, Richard B. Kreckel <kreckel at in.terlu.de> wrote:
> 
> Hi Ron,
> 
> (Sending this to mailing list, too.)
> 
> On 3/5/23 01:44, Ron Garret wrote:
>> I tried to build cln on an M1 mac and got the following error:
>> depbase=`echo base/low/cl_low_div.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
>> /bin/sh ../libtool  --tag=CXX   --mode=compile g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I../autoconf  -I../include -I../src -I../include -I../src   -g -O2 -MT base/low/cl_low_div.lo -MD -MP -MF $depbase.Tpo -c -o base/low/cl_low_div.lo base/low/cl_low_div.cc <http://cl_low_div.cc> &&\
>> mv -f $depbase.Tpo $depbase.Plo
>> libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I../autoconf -I../include -I../src -I../include -I../src -g -O2 -MT base/low/cl_low_div.lo -MD -MP -MF base/low/.deps/cl_low_div.Tpo -c base/low/cl_low_div.cc <http://cl_low_div.cc>  -fno-common -DPIC -o base/low/.libs/cl_low_div.o
>> *base/low/cl_low_div.cc:13 <http://cl_low_div.cc:13>:8: **error: **declaration of 'divu_16_rest' in global scope conflicts with declaration with C language linkage*
>> uint16 divu_16_rest;
>> *       ^*
>> *./base/cl_low.h:447:21: note: *declared with C language linkage here
>>   extern "C" uint16 divu_16_rest;                         // -> Rest r
>> *                    ^*
>> *base/low/cl_low_div.cc:104 <http://cl_low_div.cc:104>:8: **error: **declaration of 'divu_32_rest' in global scope conflicts with declaration with C language linkage*
>> uint32 divu_32_rest;
>> *       ^*
>> *./base/cl_low.h:597:21: note: *declared with C language linkage here
>>   extern "C" uint32 divu_32_rest;                         // -> Rest r
>> *                    ^*
>> *base/low/cl_low_div.cc:210 <http://cl_low_div.cc:210>:8: **error: **declaration of 'divu_64_rest' in global scope conflicts with declaration with C language linkage*
>> uint64 divu_64_rest;
>> *       ^*
>> *./base/cl_low.h:987:21: note: *declared with C language linkage here
>>   extern "C" uint64 divu_64_rest;                         // -> Rest r
>> *                    ^*
>> 3 errors generated.
>> From a cursory inspection of the code I suspect this is a problem with the preprocessor.  Specifically, this code in cl_low.h
>> #elifdefined(__arm__) && !defined(NO_ASM)
>> ...
>>   #defineNEED_VAR_divu_16_rest
>> looks highly suspect to me.  I have not traced the problem back any further than that.
>> I tried configure CPPFLAGS=-DNO_ASM but that did not fix the problem, which surprised me.  It really looks like that should have worked.
> 
> Did you use the CLN off from git?

No. I don't have autoconf installed so I was using the 1.3.6 release.

> I'm asking because patch 6edafa136b which is not in the released 1.3.6.

Thanks, that was the problem.

rg



More information about the CLN-list mailing list