CI: Update to ubuntu-26.04 - #4477
Conversation
This solves an issue with po4a that does not translates all the documents. However, some build jobs fail now and will be fixed in the following commits.
| //no more used since menu/toolbar added... | ||
| #ifdef AAAAAAAAAAAAAAAAAAAAAA | ||
| #if false | ||
| hboxbottom = gtk_hbox_new (FALSE,0); |
There was a problem hiding this comment.
The standard method is #if 0. There is usually no "false" defined and then you could just as well keep it as AAAAAAAAAAAAAAAAAAAAAA.
There was a problem hiding this comment.
Thanks, fixed. The AAAAAAAAAAAAAAAAAAAAAA seams to create issues with the new cppcheck that checks also the AAAAAAAAAAAAAAAAAAAAAA case which has a (void*)1 in it that is not worth inspecting and fixing in unused code.
| LDFLAGS := -L$(LIB_DIR) -Wl,-rpath,$(LIB_DIR) $(LIBTIRPC_LIBS) $(LDFLAGS) -latomic | ||
| else | ||
| LDFLAGS := -Wl,-rpath-link,../lib $(LIBTIRPC_LIBS) $(LDFLAGS) | ||
| LDFLAGS := -Wl,-rpath-link,../lib $(LIBTIRPC_LIBS) $(LDFLAGS) -latomic | ||
| endif |
There was a problem hiding this comment.
The question is why is this suddenly necessary?
Also, this only seems to be necessary with clang.
There was a problem hiding this comment.
The error is:
Linking rtapi_app
/usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/bits/atomic_base.h:999:(.text+0x3cd5): undefined reference to `__atomic_compare_exchange'
clang++ -std=gnu++20 -rdynamic -o ../bin/rtapi_app objects/rtapi/uspace_rtapi_main.o objects/rtapi/uspace_rtapi_app.o objects/rtapi/uspace_rtapi_parport.o objects/rtapi/uspace_rtapi_string.o objects/rtapi/rtapi_pci.o -pthread -lrt -lfmt -ludev -ldl -lcap -L/home/runner/work/linuxcnc/linuxcnc/lib -Wl,-rpath,/home/runner/work/linuxcnc/linuxcnc/lib -ltirpc -lgpiod
/usr/bin/x86_64-linux-gnu-ld.bfd: /usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/bits/atomic_base.h:999:(.text+0x3d44): undefined reference to `__atomic_compare_exchange'
/usr/bin/x86_64-linux-gnu-ld.bfd: objects/rtapi/uspace_rtapi_main.o: in function `boost::lockfree::detail::fixed_size_freelist<boost::lockfree::queue<message_t, boost::lockfree::capacity<128ul> >::node, boost::lockfree::detail::compiletime_sized_freelist_storage<boost::lockfree::queue<message_t, boost::lockfree::capacity<128ul> >::node, 129ul> >::deallocate_impl(unsigned short)':
/usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/bits/atomic_base.h:999:(.text+0x3d8d): undefined reference to `__atomic_compare_exchange'
/usr/bin/x86_64-linux-gnu-ld.bfd: /usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/bits/atomic_base.h:999:(.text+0x3dcf): undefined reference to `__atomic_compare_exchange'
/usr/bin/x86_64-linux-gnu-ld.bfd: objects/rtapi/uspace_rtapi_main.o: in function `bool std::__atomic_impl::__compare_exchange<false, boost::lockfree::detail::tagged_index>(boost::lockfree::detail::tagged_index&, std::remove_volatile<boost::lockfree::detail::tagged_index>::type&, std::remove_volatile<boost::lockfree::detail::tagged_index>::type&, bool, std::memory_order, std::memory_order)':
/usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/bits/atomic_base.h:999:(.text+0x40df): undefined reference to `__atomic_compare_exchange'
/usr/bin/x86_64-linux-gnu-ld.bfd: objects/rtapi/uspace_rtapi_main.o:/usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/bits/atomic_base.h:999: more undefined references to `__atomic_compare_exchange' follow
So it is most probably boost::lockfree that needs it, could be a boost change that behaves differently with clang. Commit is ready that adds this flag only to rtapi_app.
There was a problem hiding this comment.
https://en.cppreference.com/cpp/atomic/atomic
Quote: On GCC and Clang, some of the functionality described here requires
linking against -latomic.
There was a problem hiding this comment.
Hm... time to kill boost then, I guess. Moving to pybind11 would probably be the best way to go.
There was a problem hiding this comment.
Why pybind? It is this one:
linuxcnc/src/rtapi/uspace_rtapi_main.cc
Line 403 in d47bccc
Could be rewritten using atomics or an other library can be used but not in this PR.
There was a problem hiding this comment.
My mistake, I thought it came from gcodemodule (because it also uses boost).
Anyway, it is not right to add -latomic globally. Only the one failing should require it. And, yes, if it can be changed not to be a problem anymore, then that would actually be better.
I still do not understand how/why this fails now. Only if the size of the exchange exceeded an instruction size, but then the lockfree would be history too.
If it the dependency can be removed, then that is even better.
| #ifdef TOOL_NML //{ | ||
| tool_nml_register((CANON_TOOL_TABLE*)& _sai._tools); | ||
| tool_nml_register(& _sai._tools); | ||
| #else //}{ |
There was a problem hiding this comment.
Why doesn't this trip in emc/task/taskclass.cc, emc/usr_intf/axis/extensions/emcmodule.cc and emc/usr_intf/halui.cc?
There was a problem hiding this comment.
& _sai._tools is already type CANON_TOOL_TABLE, no need to cast it seams.
There was a problem hiding this comment.
Yes, but why does cppcheck accept the same "old style cast" in those other files?
There was a problem hiding this comment.
Where do you see one that is not a cast of NULL? Looks like either casting NULL is allowed or #ifdef / #else is not reached. Anyway, the old cppcheck also did not complain.
| CPPCHKOPT=( -j "$nproc" --force "$EXHAUSTIVE" --inline-suppr ) | ||
| CPPCHKOPT+=( "--enable=warning,performance,portability" ) | ||
| CPPCHKOPT+=( "-I$(realpath "$(dirname "$0")/../include")" ) | ||
| CPPCHKOPT+=( "-I$(realpath "$(dirname "$0")/../src/rtapi")" ) #Needed for KERNEL_VERSION and MODULE_VERBOSE macros |
There was a problem hiding this comment.
Which header is involved?
It is probably not a good idea to have this added for all files. We are trying to isolate public/private headers and the include/search order is important.
There was a problem hiding this comment.
It is rtapi.h included from hal_lib.c:
Checking hal/hal_lib_query.c: RTAPI...
hal/hal_lib.c:3477:2: error: failed to evaluate #if condition, undefined function-like macro invocation: KERNEL_VERSION( ... ) [syntaxError]
#if defined(__KERNEL__) && defined( CONFIG_PROC_FS ) && LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
^
And also an issue in mb2hal.c with MODULE_VERBOSE that got solved adding this line but I did not verify why. The error was:
Checking hal/user_comps/mb2hal/mb2hal_hal.c: MODULE_VERBOSE...
hal/user_comps/mb2hal/mb2hal.h:36:1: error: syntax error [syntaxError]
Checking hal/user_comps/mb2hal/mb2hal_hal.c: RTAPI...
MODULE_VERBOSE(emc2, "component:mb2hal:Userspace HAL component to communicate with one or more Modbus devices");
^
There was a problem hiding this comment.
It seems that there is a wrong assumption here because, f.ex., hal_lib.c needs to compile once as a user-space library and once as a RT library. These have different points of view. That means that the error must be dealt with locally and the real cause must be found. There is probably an assumption in there that cppcheck chokes on.
There was a problem hiding this comment.
Hmm, it looks like with adding this include path, cppckeck does not check any more the MODULE_VERBOSE case.
I greped the whole repo, /usr/include, /usr/src and /usr/realtime-: MODULE_VERBOSE exists only in mb2hal.h. Can this this might be just be deleted? Looks to me like a long gone makro.
28dbfc4 to
e668eb2
Compare
cppcheck passes now. Replace #ifdef AAAAA with #if 0 so cppcheck does not check unused code.
clang needs -latomic: See https://en.cppreference.com/cpp/atomic/atomic Quote: On GCC and Clang, some of the functionality described here requires linking against -latomic.
e668eb2 to
a5d5858
Compare
This solves an issue with po4a that does not translates all the document, see: #4471 (comment)
However, some build jobs fail, WIP:
cppcheckFixedclang buildFixed