CauldronDevelopmentLLC / CAMotics

Open-Source Simulation & Computer Aided Machining - A 3-axis CNC GCode simulator
Other
622 stars 143 forks source link

ld reports undefined reference to `__wrap_memcpy', '__wrap_pow', 'wrap_exp','__wrap_log_', `re2::RE2::~RE2()' #435

Open test33test opened 4 days ago

test33test commented 4 days ago

Building CAMotics from the GitHub files per the instructions offered in https://github.com/CauldronDevelopmentLLC/CAMotics on an AARCH64 system fails during the linker step regardless of the GCC version {11-13}: Cbang builds without reporting errors.

~/CAMotics$ scons ... collect2: error: ld returned 1 exit status scons: *** [camotics] Error 1 scons: building terminated because of errors.

Example Errors:

/usr/bin/ld: Application.cpp:(.text._ZN2cb11Application13versionActionEv+0x714): undefined reference to __wrap_memcpy' /usr/bin/ld: build/cairo/libcairo.a(cairo-arc.o): in function_cairo_arc_in_direction': cairo-arc.c:(.text._cairo_arc_in_direction+0x270): undefined reference to __wrap_pow' /usr/bin/ld: Evaluator.cpp:(.text._ZN5GCode9Evaluator4evalERNS_12FunctionCallE+0x7f0): undefined reference towrap_log' /usr/bin/ld: Regex.cpp:(.text._ZNK2cb5Regex15match_or_searchEbRKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS0_5MatchE+0x74): undefined reference to `re2::RE2::Arg::parse_null(char const, int, void)'

The wrap variables appear to be declared in ~/CAMotics/src/glibc.c
e.g, line 45: void *
wrap_memcpy(void dst, const void src, size_t n) {

The declarations appear to be controlled by this conditional:

if defined(CBANG_WRAP_GLIBC) && defined(GNUC) && !defined(clang) && \

!defined(_WIN32) && !defined(aarch64) && !defined(arm)

But removing it and asserting the conditional code also fails: /usr/bin/ld: build/libCAMotics.a(glibc.o): in function __wrap_log': glibc.c:(.text.__wrap_log+0x0): undefined reference tolog@GLIBC_2.2.5'

Software Versions:

/proc/version: Linux version 6.1.75-vendor-rk35xx (build@armbian) (aarch64-linux-gnu-gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1 SMP Sun Nov 24 07:23:51 UTC 2024

gcc version 13.2.0 (Ubuntu 13.2.0-23ubuntu4) [gcc (v10..v13) were tried and all fail with errors like those above] SCons: v4.5.2.12 ld (GNU Binutils for Ubuntu) 2.42

This is an Armbian/Ubuntu Neon OS, Debian version trixie/sid on a 16GB RAM 8 core rk3588s ARM SBC.

Any suggestions would be welcome.