ROS Melodic Install dkms error in Ubuntu 18.04 - Error! Bad return status for module build on kernel: 5.4.0-89-generic (x86_64) - ubuntu-18.04

I was trying to install ROS Melodic, and got this error:-
(ROSMelodic) (system) t#tsd:~/git/ROSMelodic$ sudo apt install ros-melodic-desktop-full
Reading package lists... Done
Building dependency tree
Reading state information... Done
ros-melodic-desktop-full is already the newest version (1.4.1-0bionic.20211216.192238).
The following packages were automatically installed and are no longer required:
golang-docker-credential-helpers gyp libjs-async libjs-inherits <etc. etc. long list of installed packages...>
Use 'sudo apt autoremove' to remove them.
0 to upgrade, 0 to newly install, 0 to remove and 87 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up darling-dkms (0.1.20200331~testing) ...
>>> DKMS: Module add, build, and install....................................................................................................................................................................................]
darling-mach, 0.1: added
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area...
'make' -C lkm/ MIGDIR=/usr/src/darling-mach-0.1/miggen MIGDIR_REL=../miggen KERNELVERSION=5.4.0-89-generic.........(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.4.0-89-generic (x86_64)
Consult /var/lib/dkms/darling-mach/0.1/build/make.log for more information.
dpkg: error processing package darling-dkms (--configure):
installed darling-dkms package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
darling-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)
This is what is in the make.log :-
(ROSMelodic) (system) t#tsd:~/git/ROSMelodic$ cat /var/lib/dkms/darling-mach/0.1/build/make.log
DKMS make.log for darling-mach-0.1 for kernel 5.4.0-89-generic (x86_64)
Mon 17 Jan 01:19:25 GMT 2022
make: Entering directory '/var/lib/dkms/darling-mach/0.1/build/lkm'
Running kernel version is 5.4.0-89-generic
rm -f darling-mach.mod.o
make -C /lib/modules/5.4.0-89-generic/build M=/var/lib/dkms/darling-mach/0.1/build/lkm modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-89-generic'
Running kernel version is 5.4.0-89-generic
Invoked by kernel build system, building for 5.4.0-89-generic
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_entry.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_hash.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_space.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_kmsg.o
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_kmsg.c:140:0:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_kmsg.c: In function ‘ipc_kmsg_get’:
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/debug_print.h:29:55: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘mach_port_t {aka struct ipc_port *}’ [-Wformat=]
not sure what this is about ?
# define debug_msg(fmt, ...) if (debug_output) printk("\0015Darling Mach: <%d> " fmt, linux_current->pid, ##__VA_ARGS__)
^
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_kmsg.c:1597:5: note: in expansion of macro ‘debug_msg’
debug_msg( "- ikm_header->msgh_size: %d, bits: 0x%x rport: 0x%x, lport: 0x%x, reserved: 0x%x, id: %d\n",
^~~~~~~~~
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_kmsg.c:1597:67: note: format string is defined here
debug_msg( "- ikm_header->msgh_size: %d, bits: 0x%x rport: 0x%x, lport: 0x%x, reserved: 0x%x, id: %d\n",
what is this about ?
~^
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_kmsg.c:140:0:
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/debug_print.h:29:55: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘mach_port_t {aka struct ipc_port *}’ [-Wformat=]
# define debug_msg(fmt, ...) if (debug_output) printk("\0015Darling Mach: <%d> " fmt, linux_current->pid, ##__VA_ARGS__)
^
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_kmsg.c:1597:5: note: in expansion of macro ‘debug_msg’
debug_msg( "- ikm_header->msgh_size: %d, bits: 0x%x rport: 0x%x, lport: 0x%x, reserved: 0x%x, id: %d\n",
^~~~~~~~~
hmmm not sure about this
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_kmsg.c:1597:80: note: format string is defined here
debug_msg( "- ikm_header->msgh_size: %d, bits: 0x%x rport: 0x%x, lport: 0x%x, reserved: 0x%x, id: %d\n",
~^
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_kmsg.c: In function ‘ipc_kmsg_copyin’:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_kmsg.c:3228:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if ((kmsg->ikm_header->msgh_bits & MACH_MSGH_BITS_COMPLEX) == 0)
^~
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_kmsg.c:3231:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
mr = ipc_kmsg_copyin_body( kmsg, space, map);
^~
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_notify.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_object.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_pset.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_table.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_voucher.o
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_voucher.c: In function ‘ipc_get_pthpriority_from_kmsg_voucher’:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_voucher.c:2636:2: warning: ISO C90 forbids variable length array ‘content_data’ [-Wvla]
uint8_t content_data[content_size];
^~~~~~~
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_voucher.c: In function ‘ipc_execute_voucher_recipe_command’:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_voucher.c:1509:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (MACH_VOUCHER_ATTR_KEY_ALL == key) {
^
what is this about ?
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_voucher.c:1550:2: note: here
default:
^~~~~~~
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_voucher.c: In function ‘iv_dedup’:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_voucher.c:1760:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=]
}
^
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/mig_log.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/mach_port.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/mach_msg.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/mach_debug.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/mach_kernelrpc.o
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/mach_kernelrpc.c: In function ‘host_create_mach_voucher_trap’:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/mach_kernelrpc.c:446:3: warning: ISO C90 forbids variable length array ‘krecipes’ [-Wvla]
uint8_t krecipes[args->recipes_size];
^~~~~~~
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/mach_kernelrpc.c: In function ‘mach_voucher_extract_attr_recipe_trap’:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/mach_kernelrpc.c:501:3: warning: ISO C90 forbids variable length array ‘krecipe’ [-Wvla]
uint8_t krecipe[sz];
^~~~~~~
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_init.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_right.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_mqueue.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/ipc/ipc_port.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/sync_sema.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/darling/down_interruptible.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/darling/traps.o
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct.h:112:0,
from /var/lib/dkms/darling-mach/0.1/build/lkm/darling/traps.c:20:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct__pre_xnu_types.h:101:33: warning: ‘struct xnu_rlimit’ declared inside parameter list will not be visible outside of this definition or declaration
#define rlimit xnu_rlimit
^
./include/linux/sched/mm.h:137:14: note: in expansion of macro ‘rlimit’
struct rlimit *rlim_stack);
^~~~~~
not sure about this
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/traps.c: In function ‘handle_to_path_entry’:
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/traps.c:1779:10: warning: return makes integer from pointer without a cast [-Wint-conversion]
return ERR_PTR(-LINUX_EBADF);
^~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/traps.c:1842:1: warning: the frame size of 4208 bytes is larger than 1024 bytes [-Wframe-larger-than=]
}
^
CC [M] /var/lib/dkms/darling- etc...
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c: In function ‘evpsetfd_read’:
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:202:9: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
addr = process_data;
^
interesting
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:37:0:
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c: In function ‘knote’:
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/debug_print.h:29:55: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘struct xnu_klist *’ [-Wformat=]
# define debug_msg(fmt, ...) if (debug_output) printk("\0015Darling Mach: <%d> " fmt, linux_current->pid, ##__VA_ARGS__)
^
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:359:5: note: in expansion of macro ‘debug_msg’
debug_msg("knote() on list 0x%x called with hint=0x%x\n", list, hint);
^~~~~~~~~
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:359:35: note: format string is defined here
debug_msg("knote() on list 0x%x called with hint=0x%x\n", list, hint);
~^
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:37:0:
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/debug_print.h:29:55: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long int’ [-Wformat=]
# define debug_msg(fmt, ...) if (debug_output) printk("\0015Darling Mach: <%d> " fmt, linux_current->pid, ##__VA_ARGS__)
^
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:359:5: note: in expansion of macro ‘debug_msg’
debug_msg("knote() on list 0x%x called with hint=0x%x\n", list, hint);
^~~~~~~~~
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:359:57: note: format string is defined here
debug_msg("knote() on list 0x%x called with hint=0x%x\n", list, hint);
~^
i
%lx
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:37:0:
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/debug_print.h:29:55: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘wait_queue_head_t * {aka struct wait_queue_head *}’ [-Wformat=]
# define debug_msg(fmt, ...) if (debug_output) printk("\0015Darling Mach: <%d> " fmt, linux_current->pid, ##__VA_ARGS__)
^
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:368:3: note: in expansion of macro ‘debug_msg’
debug_msg("knote() is waking up a Linux wait queue 0x%x\n", &kn->wait_queue);
^~~~~~~~~
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:368:57: note: format string is defined here
debug_msg("knote() is waking up a Linux wait queue 0x%x\n", &kn->wait_queue);
~^
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:37:0:
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c: In function ‘knote_attach_evpset’:
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/debug_print.h:29:55: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘struct xnu_klist *’ [-Wformat=]
# define debug_msg(fmt, ...) if (debug_output) printk("\0015Darling Mach: <%d> " fmt, linux_current->pid, ##__VA_ARGS__)
^
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:381:2: note: in expansion of macro ‘debug_msg’
debug_msg("Attaching to klist 0x%x\n", list);
^~~~~~~~~
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:381:35: note: format string is defined here
debug_msg("Attaching to klist 0x%x\n", list);
~^
wrote
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:37:0:
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c: In function ‘knote_detach_evpset’:
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/debug_print.h:29:55: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘struct xnu_klist *’ [-Wformat=]
# define debug_msg(fmt, ...) if (debug_output) printk("\0015Darling Mach: <%d> " fmt, linux_current->pid, ##__VA_ARGS__)
^
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:388:2: note: in expansion of macro ‘debug_msg’
debug_msg("Detaching from klist 0x%x\n", list);
^~~~~~~~~
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/evpsetfd.c:388:37: note: format string is defined here
debug_msg("Detaching from klist 0x%x\n", list);
~^
these
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/darling/pthread_kill.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/darling/psynch_support.o
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/psynch_support.c: In function ‘kwq_handle_unlock’:
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/psynch_support.c:3510:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
longreadset = 1;
~~~~~~~~~~~~^~~
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/psynch_support.c:3512:3: note: here
case PTH_RW_TYPE_READ: {
^~~~
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/darling/foreign_mm.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/darling/continuation.o
AS [M] /var/lib/dkms/darling-mach/0.1/build/lkm/darling/continuation-asm.o
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/continuation-asm.S:6:16: warning: extra tokens at end of #ifndef directive
#ifndef ENDPROC(name)
^
words
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/continuation-asm.o: warning: objtool: cont_setjmp()+0x23: indirect jump found in RETPOLINE build
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/continuation-asm.o: warning: objtool: cont_longjmp()+0x2a: indirect jump found in RETPOLINE build
/var/lib/dkms/darling-mach/0.1/build/lkm/darling/continuation-asm.o: warning: objtool: cont_setjmp()+0x23: sibling call from callable instruction with modified stack frame
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/darling_xnu_init.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_atomic.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_ipc_pset.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_clock.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_debug.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_kalloc.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_printf.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_startup.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_sysctl.o
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_task.o
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct.h:112:0,
from /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_task.c:36:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct__pre_xnu_types.h:101:33: warning: ‘struct xnu_rlimit’ declared inside parameter list will not be visible outside of this definition or declaration
#define rlimit xnu_rlimit
^
to
./include/linux/sched/mm.h:137:14: note: in expansion of macro ‘rlimit’
struct rlimit *rlim_stack);
^~~~~~
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_thread_act.o
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct.h:112:0,
from /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_thread_act.c:36:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct__pre_xnu_types.h:101:33: warning: ‘struct xnu_rlimit’ declared inside parameter list will not be visible outside of this definition or declaration
#define rlimit xnu_rlimit
^
break
./include/linux/sched/mm.h:137:14: note: in expansion of macro ‘rlimit’
struct rlimit *rlim_stack);
^~~~~~
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_thread.o
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_thread.c: In function ‘duct_thread_bootstrap’:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_thread.c:207:2: warning: #warning Init thread initialization disabled! [-Wcpp]
#warning Init thread initialization disabled!
^~~~~~~
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_thread.c: In function ‘duct_thread_create_internal’:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_kern_thread.c:273:2: warning: #warning compat_uthread disabled [-Wcpp]
#warning compat_uthread disabled
^~~~~~~
up
etc...
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct.h:112:0,
from /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_vm_user.c:35:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct__pre_xnu_types.h:101:33: warning: ‘struct xnu_rlimit’ declared inside parameter list will not be visible outside of this definition or declaration
#define rlimit xnu_rlimit
^
the
./include/linux/sched/mm.h:137:14: note: in expansion of macro ‘rlimit’
struct rlimit *rlim_stack);
^~~~~~
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_arm_locks_arm.o
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_arm_locks_arm.h:44:0,
from /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/duct/duct_arm_locks_arm.c:36:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/i386/lock.h:72:2: warning: #warning This header is deprecated. Use <kern/locks.h> instead. [-Wcpp]
#warning This header is deprecated. Use <kern/locks.h> instead.
^~~~~~~
log
etc...
mach/0.1/build/lkm/osfmk/kern/host.o
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/host.c: In function ‘host_statistics64’:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/host.c:562:23: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
stat->active_count = totalram_pages - stat->free_count;
^
so
etc...
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/locks.o
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/locks.c:801:1: warning: ‘lck_mtx_clear_promoted’ defined but not used [-Wunused-function]
lck_mtx_clear_promoted (
^~~~~~~~~~~~~~~~~~~~~~
it
etc...
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/waitq.o
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/waitq.c:63:0:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/backtrace.h:51:2: warning: ‘not_tail_called’ attribute directive ignored [-Wattributes]
__attribute__((noinline,not_tail_called));
^~~~~~~~~~~~~
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/waitq.c: In function ‘wq_prepost_alloc’:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/waitq.c:829:1: warning: label ‘out’ defined but not used [-Wunused-label]
out:
^~~
passes
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/waitq.c: In function ‘waitq_alloc_prepost_reservation’:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/waitq.c:4452:1: warning: label ‘do_alloc’ defined but not used [-Wunused-label]
do_alloc:
^~~~~~~~
At top level:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/waitq.c:692:13: warning: ‘wq_prepost_refill_cpu_cache’ defined but not used [-Wunused-function]
static void wq_prepost_refill_cpu_cache(uint32_t nalloc)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/duct/osfmk/dummy-locks.o
In file included from /var/lib/dkms/darling-mach/0.1/build/lkm/duct/osfmk/dummy-locks.c:76:0:
/var/lib/dkms/darling-mach/0.1/build/lkm/osfmk/kern/lock.h:71:2: warning: #warning This header is deprecated. Use <kern/locks.h> instead. [-Wcpp]
#warning This header is deprecated. Use <kern/locks.h> instead.
^~~~~~~
/var/lib/dkms/darling-mach/0.1/build/lkm/duct/osfmk/dummy-locks.c:113:2: warning: #warning Implement locks? [-Wcpp]
#warning Implement locks?
^~~~~~~
for
CC [M] /var/lib/dkms/darling-mach/0.1/build/lkm/duct/osfmk/dummy-misc.o
/var/lib/dkms/darling-mach/0.1/build/lkm/duct/osfmk/dummy-misc.c: In function ‘mach_memory_info’:
/var/lib/dkms/darling-mach/0.1/build/lkm/duct/osfmk/dummy-misc.c:234:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
stack overflow submission
cc1: some warnings being treated as errors
scripts/Makefile.build:270: recipe for target '/var/lib/dkms/darling-mach/0.1/build/lkm/duct/osfmk/dummy-misc.o' failed
make[2]: *** [/var/lib/dkms/darling-mach/0.1/build/lkm/duct/osfmk/dummy-misc.o] Error 1
Makefile:1762: recipe for target '/var/lib/dkms/darling-mach/0.1/build/lkm' failed
make[1]: *** [/var/lib/dkms/darling-mach/0.1/build/lkm] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-89-generic'
Makefile:325: recipe for target 'default' failed
make: *** [default] Error 2
make: Leaving directory '/var/lib/dkms/darling-mach/0.1/build/lkm'
(ROSMelodic) (system) t#tsd:~/git/ROSMelodic$
Wondering what I need to do to get the install of ROS Melodic working on my Ubuntu 18.04 machine
Trying Pedros suggestions:-
(ROSMelodic) (system) t#tsd:~/git/ROSMelodic$ sudo apt remove darling-dkms # remove faulty package
[sudo] password for t:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
golang-docker-credential-helpers ... etc...
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED
darling-dkms
0 to upgrade, 0 to newly install, 1 to remove and 85 not to upgrade.
1 not fully installed or removed.
After this operation, 63.5 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 426334 files and directories currently installed.)...]
Removing darling-dkms (0.1.20200331~testing) ...
>>> DKMS: Module uninstall
darling-mach, 0.1: added
------------------------------
Deleting module version: 0.1
completely from the DKMS tree.
------------------------------
Done.
(ROSMelodic) (system) timur#tsd:~/git/ROSMelodic$ sudo apt update && sudo apt upgrade
etc.
Hit:38 https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64 InRelease
Err:39 https://dl.bintray.com/rabbitmq-erlang/debian bionic InRelease
502 Bad Gateway [IP: 52.39.229.247 443]
Get:40 http://gb.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [294 kB]
Err:41 https://dl.bintray.com/rabbitmq/debian bionic InRelease
502 Bad Gateway [IP: 52.39.229.247 443]
Get:42 http://gb.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [300 kB]
Get:43 http://gb.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,468 B]
Get:44 http://gb.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [9,272 B]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/nemonein/ksnip/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:56 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:56 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (stable/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list:56 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:56 and /etc/apt/sources.list.d/docker.list:1
W: Target DEP-11 (stable/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:56 and /etc/apt/sources.list.d/docker.list:1
sudo apt install darling-dkms
E: Unable to locate package darling-dkms

The first problem probably made all the other errors message to appear, probably check darling-dkms.
sudo apt remove darling-dkms # remove faulty package
sudo apt update && sudo apt upgrade # update & upgrade packages. This should also upgrade your kernel to a newer version (for me, this was 5.10.0-1051-oem)
sudo apt install darling-dkms
Which one do you have installed and what is the required version?
Also, did you check installation guide:
http://wiki.ros.org/melodic/Installation/Ubuntu
There are some pre-installation steps:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
And:
sudo apt install curl # if you haven't already installed curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

Downloading and installing the Debian of darling from this website
https://github.com/darlinghq/darling/releases
https://github.com/darlinghq/darling/releases/download/v0.1.20210224/darling-dkms_0.1.20210224.testing_amd64.deb
solved this darling-dkms error
From following the instructions in the ROS website, I also had to do this
sudo pip install rosdep==0.21.0

Related

_ASM_EXTABLE_HANDLE virtualization compilation failure

I'm trying to compile this project from github but I am running into the following error:
make -C /lib/modules/5.15.0-53-generic/build M=/home/jr/Documents/ProtoVirt modules EXTRA_CFLAGS="-g -DDEBUG"
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-53-generic'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
You are using: gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
CC [M] /home/jr/Documents/ProtoVirt/protovirt.o
In file included from /home/jr/Documents/ProtoVirt/protovirt.c:23:
/home/jr/Documents/ProtoVirt/protovirt.h: In function ‘__rdmsr1’:
/home/jr/Documents/ProtoVirt/protovirt.h:25:22: error: expected ‘:’ or ‘)’ before ‘_ASM_EXTABLE_HANDLE’
25 | _ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_rdmsr_unsafe)
| ^~~~~~~~~~~~~~~~~~~
/home/jr/Documents/ProtoVirt/protovirt.h:25:42: error: invalid suffix "b" on integer constant
25 | _ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_rdmsr_unsafe)
| ^~
/home/jr/Documents/ProtoVirt/protovirt.h:25:46: error: invalid suffix "b" on integer constant
25 | _ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_rdmsr_unsafe)
| ^~
/home/jr/Documents/ProtoVirt/protovirt.c: In function ‘initVmcsControlField’:
/home/jr/Documents/ProtoVirt/protovirt.c:282:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
282 | void *costum_rip;
| ^~~~
make[2]: *** [scripts/Makefile.build:297: /home/jr/Documents/ProtoVirt/protovirt.o] Error 1
make[1]: *** [Makefile:1903: /home/jr/Documents/ProtoVirt] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-53-generic'
make: *** [Makefile:12: modules] Error 2
The command I'm running is make. Can anyone explain to me what I'm doing wrong?
The _ASM_EXTABLE_HANDLE macro is replaced by _ASM_EXTABLE_TYPE in the newest kernel versions.

How should I compile this old code with cc

I'm trying to compile source code, that from 2001, in Ubuntu 18.04.2 LTS. But, I got the errors below and actually don't know how I have to change the compiling code. Can you help me for compiling this code?
Suggested compilation part from the program
SUGGESTED COMPILATION COMMAND LINE (FOR A DEC-ALPHA CC-COMPILER):
cc -lm -fast -tune host -arch host -assume whole_program \
-o mol_volume mol_volume.c
When I tried this code, errors;
cc: error: host: No such file or directory
cc: error: host: No such file or directory
cc: error: whole_program: No such file or directory
cc: error: unrecognized command line option ‘-fast’; did you mean ‘-Ofast’?
cc: error: unrecognized command line option ‘-tune’; did you mean ‘-mtune=’?
cc: error: unrecognized command line option ‘-arch’; did you mean ‘-march=’?
cc: error: unrecognized command line option ‘-assume’; did you mean ‘-msse’?
Then, I changed -fast, -tune, -arch, -assume flags with -Ofast, -mtune=native, -march=native, -msse then add the path the for the directory part of the errors.
cc -lm -Ofast -mtune=native -march=native -msse /mypath/ -o mol_volume mol_volume.c
Then, I got that error;
mol_volume.c: In function ‘main’:
mol_volume.c:235:10: warning: implicit declaration of function ‘gets’; did you mean ‘fgets’? [-Wimplicit-function-declaration]
while( gets(s) ) {
^~~~
fgets
mol_volume.c:311:26: warning: format ‘%i’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=]
printf("WARNING: the %i-th atom of the pdb file %s has an unknown chemical type %s.\n",
~^
%li
i+1, pdb_name, atom_type);
~~~
/usr/bin/ld: cannot find .: File format not recognized
collect2: error: ld returned 1 exit status
You can access the source code via this link;
Source Code
My PC info:
Operation System: Ubuntu 18.04.2 LTS
Kernel ver.: 4.15.0-50-generic
GCC ver.: 7.4.0
gets was removed in C11. Compile with gcc -o mol_volume -Wall -std=c99 -mtune=native -O3 mol_volume.c -lm.
It will work but you should fix the code to remove all the warnings.

Why does my Thrift (c_glib) example fail to compile with "error: invalid conversion"?

I'm trying out the thrift c_glib example (minimal version just with ping) that is available in the official thrift website, but whenever i compile the code (gcc or make) it fails with following reason:
thrift-server.c: In function ‘int main()’:
thrift-server.c:186:23: error: invalid conversion from ‘gpointer {aka void*}’ to ‘TutorialCalculatorHandler* {aka _TutorialCalculatorHandler*}’ [-fpermissive]
NULL);
^
thrift-server.c:194:23: error: invalid conversion from ‘gpointer {aka void*}’ to ‘CalculatorProcessor* {aka _CalculatorProcessor*}’ [-fpermissive]
NULL);
^
thrift-server.c:201:23: error: invalid conversion from ‘gpointer {aka void*}’ to ‘ThriftServerTransport* {aka _ThriftServerTransport*}’ [-fpermissive]
NULL);
^
thrift-server.c:208:23: error: invalid conversion from ‘gpointer {aka void*}’ to ‘ThriftTransportFactory* {aka _ThriftTransportFactory*}’ [-fpermissive]
NULL);
^
thrift-server.c:214:23: error: invalid conversion from ‘gpointer {aka void*}’ to ‘ThriftProtocolFactory* {aka _ThriftProtocolFactory*}’ [-fpermissive]
NULL);
^
thrift-server.c:225:23: error: invalid conversion from ‘gpointer {aka void*}’ to ‘ThriftServer* {aka _ThriftServer*}’ [-fpermissive]
NULL);
^
thrift-server.c:176:7: warning: unused variable ‘exit_status’ [-Wunused-variable]
int exit_status = 0;
^
thrift-server.c: At global scope:
thrift-server.c:154:1: warning: ‘void sigint_handler(int)’ defined but not used [-Wunused-function]
sigint_handler (int signal_number)
^
make: *** [server] Error 1
Any pointers will be really helpful. My GCC version is 4.8.2 and I'm on a ubuntu 14.10 box
And my makefile looks like this:
default: server
server: thrift-server.c
gcc -g -Wall -Wextra -pedantic -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -g -O2 -o thrift-server.o -c thrift-server.c /home/akhld/mobi/localcluster/codes/private/simdprototype/thrift-0.9.2/tutorial/c_glib/.libs/libtutorialgencglib.a -lgobject-2.0 -lglib-2.0 /home/akhld/mobi/localcluster/codes/private/simdprototype/thrift-0.9.2/lib/c_glib/.libs/libthrift_c_glib.so /home/akhld/mobi/localcluster/codes/private/simdprototype/thrift-0.9.2/lib/c_glib/.libs/libthrift_c_glib.so -lssl -lcrypto -lrt -lpthread -Wl,-rpath -Wl,/home/akhld/mobi/localcluster/codes/private/simdprototype/thrift-0.9.2/lib/c_glib/.libs
This is how my .thrift file looks like:
namespace cpp tutorial
service Calculator {
void ping()
}
And this is the thrift-server.c:
http://pastebin.com/Q4SGAdMu
Try compiling your code with gcc, not g++ (change the last line of your makefile). C++, but not C, requires explicit conversions from void *.
If you must use g++ for some reason, try instead adding an explicit cast to each call to g_object_new, e.g.:
handler = (TutorialCalculatorHandler *)
g_object_new (TYPE_TUTORIAL_CALCULATOR_HANDLER,
NULL);

Makefile and program structure Raspberry Pi GCC

I' m trying to setup a simple tool to measure different aspects of a system. I build a project which can log an accelerometer, gyroscope and a magnetometer. I want full control of the the program so I decided not to use any usr/local kind of libraries and keep all files in the project folder. All files all working. I want to make the structure of my program as follows: https://www.dropbox.com/s/59s3si8spvkdq98/filestructure.png (not enough REP). I don't have much experience in making Makefiles, except changing a few variables. I work in the Embedded environment and mostly with IDE's.
I tried building my project with the following Makefile:
# Project name
NAME = TEST
# Tools
CC = gcc
CFLAGS = -o
# Paths
DRV_PATH = drivers
SRC_PATH = src
LIB_PATH = libs
# includes
INCLUDES = -I $(DRV_PATH) -I $(LIB_PATH) -I $(SRC_PATH)
# what files do we need to compile?
# libraries
MY_LIB = $(LIB_PATH)/bcm2835.c
# main files
MAIN = main.c
# src files
#MY_SRC = $(SRC_PATH)/vector.c
MY_SRC += $(SRC_PATH)/dcm.c
# select drivers to compile
DRV_SRC = $(DRV_PATH)/adxl345.c
DRV_SRC += $(DRV_PATH)/itg3200.c
DRV_SRC += $(DRV_PATH)/hmc5883l.c
DRV_SRC += $(DRV_PATH)/gy-85.c
DRV_SRC += $(DRV_PATH)/nrf24l01.c
# bundle files
ALL_SRC = $(MY_LIB) $(DRV_SRC) $(MY_SRC) $(MAIN)
OBJ = $(ALL:.c=.o)
BIN = $(ALL:.c=)
# make commands
all:
$(CC) $(CFLAGS) $(NAME) $(ALL_SRC)
debug:
$(CC) $(CFLAGS) $(NAME) $(ALL_SRC) -DDEBUG=1
imudebug:
$(CC) $(CFLAGS) $(NAME) $(ALL_SRC) -DIMUDEBUG=1
nrfdebug:
$(CC) $(CFLAGS) $(NAME) $(ALL_SRC) -DNRFDEBUG=1
I use the different make commands to generate some debug output.
The config file currently includes all files and is as follows:
#ifndef CONFIG_H
#define CONFIG_H
/* includes */
#include <stdio.h>
#include <math.h>
/* libs */
#include <bcm2835.h>
/* drivers */
#include "gy-85.h"
#include "adxl345.h"
#include "itg3200.h"
#include "hmcl5883l.h"
#include "nrf24l01.h"
/* src */
#include "dcm.h"
#endif // __CONFIG_H__
And the dcm.h file looks as follows. I tried t keep all .h files like this:
#ifndef DCM_H
#define DCM_H
#include <bcm2835.h>
#include <stdio.h>
#include <math.h>
#include "gy-85.h"
double pitch, roll, yaw;
double DCM_Matrix[3][3];
uint64_t stamp;
void resetFusion(void);
#endif
This is my make result:
gcc -o TEST libs/bcm2835.c drivers/adxl345.c drivers/itg3200.c drivers/hmc5883l.c drivers/gy-85.c drivers/nrf24l01.c src/dcm.c main.c
In file included from drivers/adxl345.c:1:0:
drivers/adxl345.h:4:21: fatal error: bcm2835.h: No such file or directory
compilation terminated.
In file included from drivers/itg3200.c:1:0:
drivers/itg3200.h:4:21: fatal error: bcm2835.h: No such file or directory
compilation terminated.
drivers/hmc5883l.c: In function ‘magInit’:
drivers/hmc5883l.c:7:30: error: ‘MAG_ADDR’ undeclared (first use in this function)
drivers/hmc5883l.c:7:30: note: each undeclared identifier is reported only once for each function it appears in
drivers/hmc5883l.c:14:17: error: ‘MODE’ undeclared (first use in this function)
drivers/hmc5883l.c:14:23: error: ‘CONTINUOUS’ undeclared (first use in this function)
drivers/hmc5883l.c:22:17: error: ‘CONA’ undeclared (first use in this function)
drivers/hmc5883l.c:22:23: error: ‘RATE_50HZ’ undeclared (first use in this function)
drivers/hmc5883l.c: In function ‘magRead’:
drivers/hmc5883l.c:37:30: error: ‘MAG_ADDR’ undeclared (first use in this function)
drivers/hmc5883l.c:38:18: error: ‘DATA’ undeclared (first use in this function)
drivers/hmc5883l.c: In function ‘magGetRegister’:
drivers/hmc5883l.c:60:13: error: ‘BCM2835_I2C_REASON_OK’ undeclared (first use in this function)
drivers/hmc5883l.c:61:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
drivers/hmc5883l.c: At top level:
drivers/hmc5883l.c:71:6: warning: conflicting types for ‘magGetRegisters’ [enabled by default]
drivers/hmc5883l.c:38:2: note: previous implicit declaration of ‘magGetRegisters’ was here
drivers/hmc5883l.c: In function ‘magGetRegisters’:
drivers/hmc5883l.c:79:13: error: ‘BCM2835_I2C_REASON_OK’ undeclared (first use in this function)
drivers/hmc5883l.c:80:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
drivers/hmc5883l.c: At top level:
drivers/hmc5883l.c:97:6: warning: conflicting types for ‘magSetRegister’ [enabled by default]
drivers/hmc5883l.c:14:2: note: previous implicit declaration of ‘magSetRegister’ was here
drivers/hmc5883l.c: In function ‘magSetRegister’:
drivers/hmc5883l.c:107:13: error: ‘BCM2835_I2C_REASON_OK’ undeclared (first use in this function)
drivers/hmc5883l.c:108:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
drivers/gy-85.c: In function ‘gyInit’:
drivers/gy-85.c:15:30: error: ‘BCM2835_I2C_CLOCK_DIVIDER_2500’ undeclared (first use in this function)
drivers/gy-85.c:15:30: note: each undeclared identifier is reported only once for each function it appears in
drivers/gy-85.c: In function ‘gyUpdate’:
drivers/gy-85.c:29:2: error: unknown type name ‘int16_t’
drivers/gy-85.c:30:2: error: unknown type name ‘uint8_t’
drivers/gy-85.c:32:9: error: ‘int16_t’ undeclared (first use in this function)
drivers/gy-85.c:32:18: error: expected expression before ‘)’ token
drivers/gy-85.c:40:18: error: expected expression before ‘)’ token
drivers/gy-85.c:47:18: error: expected expression before ‘)’ token
drivers/gy-85.c:61:2: warning: return from incompatible pointer type [enabled by default]
In file included from drivers/nrf24l01.c:1:0:
drivers/nrf24l01.h:5:21: fatal error: bcm2835.h: No such file or directory
compilation terminated.
In file included from src/dcm.c:1:0:
src/dcm.h:4:21: fatal error: bcm2835.h: No such file or directory
compilation terminated.
In file included from main.c:1:0:
config.h:9:21: fatal error: bcm2835.h: No such file or directory
compilation terminated.
make: *** [all] Error 1
If you can point out the main problem with my file structure I would be so glad!
Current error list:
gcc -o TEST -I libs -I drivers -I src libs/bcm2835.c drivers/adxl345.c drivers/itg3200.c drivers/hmc5883l.c drivers/gy-85.c drivers/nrf24l01.c src/dcm.c main.c
drivers/gy-85.c: In function ‘gyUpdate’:
drivers/gy-85.c:63:2: warning: return from incompatible pointer type [enabled by default]
main.c: In function ‘main’:
main.c:51:4: warning: passing argument 1 of ‘nrf24Transmit’ from incompatible pointer type [enabled by default]
drivers/nrf24l01.h:145:9: note: expected ‘uint8_t *’ but argument is of type ‘uint64_t *’
/tmp/ccOWR401.o:(.bss+0x0): multiple definition of `accelRaw'
/tmp/cc1gy1Bh.o:(.bss+0x0): first defined here
/tmp/ccOWR401.o:(.bss+0x8): multiple definition of `accelBias'
/tmp/cc1gy1Bh.o:(.bss+0x8): first defined here
/tmp/ccyZlhJe.o:(.bss+0x0): multiple definition of `accelRaw'
/tmp/cc1gy1Bh.o:(.bss+0x0): first defined here
/tmp/ccyZlhJe.o:(.bss+0x8): multiple definition of `accelBias'
/tmp/cc1gy1Bh.o:(.bss+0x8): first defined here
/tmp/ccUbOIyA.o:(.bss+0x0): multiple definition of `accelRaw'
/tmp/cc1gy1Bh.o:(.bss+0x0): first defined here
/tmp/ccUbOIyA.o:(.bss+0x8): multiple definition of `accelBias'
/tmp/cc1gy1Bh.o:(.bss+0x8): first defined here
/tmp/ccyZlhJe.o: In function `resetFusion':
dcm.c:(.text+0x38): undefined reference to `atan2'
collect2: ld returned 1 exit status
make: *** [all] Error 1
You don't have your includes in your rule
INCLUDES = -I $(DRV_PATH) -I $(LIB_PATH) -I $(SRC_PATH)
This just seems to dangle. Simplest solution to my eyes is to move down your CFLAGS definition and add in the includes:
INCLUDES = -I $(DRV_PATH) -I $(LIB_PATH) -I $(SRC_PATH)
CFLAGS = -o $(INCLUDES)
This way you don't have to change anything else. Of course, there are alternatives, this one just looks easiest.

Compiling XFCE4 panel plugin

I am converting a gnome panel applet to xfce panel plugin. I have so far removed the few gnome specific parts in the source and replaced them with xfce specific source as appropriate.
I created makefile.am and configure.ac files using templates such as the weather plugin and the example plugin. However I am unsuccessful in getting it compiled properly. I am probably missing something obvious, but I double checked the examples with my own files and found no obvious problems.
I have attached the appropriate files as well as output of the errors in the hope someone has an idea. I don't think the problem is in the actual source, but I can add some of that later if necessary.
Errors while compiling:
make all-recursive
make[1]: Entering directory `/source/my_example_xfce'
Making all in panel-plugin
make[2]: Entering directory `/source/my_example_xfce/panel-plugin'
gcc -DHAVE_CONFIG_H -I. -I.. -I.. -DTHEMESDIR=\"/usr/local/share/xfce4/my_example/icons\" -DPACKAGE_LOCALE_DIR=\"/usr/local/share/locale\" -DG_LOG_DOMAIN=\"my_example\" -DNDEBUG -pthread -I/usr/include/xfce4/libxfce4panel-1.0 -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/xfce4 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/atk-1.0 -I/usr/include/xfce4 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/xfce4 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -g -O2 -MT xfce4_my_example_plugin-my_example.o -MD -MP -MF .deps/xfce4_my_example_plugin-my_example.Tpo -c -o xfce4_my_example_plugin-my_example.o `test -f 'my_example.c' || echo './'`my_example.c
my_example.c:25:25: warning: ‘struct Example_Data’ declared inside parameter list [enabled by default]
my_example.c:25:25: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
my_example.c: In function ‘setdefaults’:
my_example.c:28:3: warning: incompatible implicit declaration of built-in function ‘strncpy’ [enabled by default]
my_example.c:28:21: error: dereferencing pointer to incomplete type
my_example.c:28:45: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default]
my_example.c:28:3: warning: passing argument 1 of ‘strlen’ makes pointer from integer without a cast [enabled by default]
my_example.c:28:3: note: expected ‘const char *’ but argument is of type ‘int’
my_example.c:28:3: warning: passing argument 2 of ‘strncpy’ makes pointer from integer without a cast [enabled by default]
my_example.c:28:3: note: expected ‘const char *’ but argument is of type ‘int’
my_example.c:30:21: error: dereferencing pointer to incomplete type
my_example.c:30:42: error: dereferencing pointer to incomplete type
my_example.c:30:67: error: dereferencing pointer to incomplete type
my_example.c:31:3: warning: incompatible implicit declaration of built-in function ‘strncat’ [enabled by default]
my_example.c:31:21: error: dereferencing pointer to incomplete type
my_example.c:31:32: error: ‘SIGFILE’ undeclared (first use in this function)
SIGFILE is one of the defines in my header files. Then it goes on as if it never read my header files with all the declarations.
Last bit:
my_example.c:248:17: error: unknown type name ‘XfcePanelPlugin’
my_example.c:248:42: error: unknown type name ‘GtkWidget’
my_example.c:248:60: error: unknown type name ‘GtkWidget’
make[2]: *** [xfce4_my_example_plugin-example.o] Error 1
make[2]: Leaving directory `/source/my_example_xfce/panel-plugin'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/source/my_example_xfce'
make: *** [all] Error 2
Below I pasted Makefile.am, configure.ac and panel-plugin/Makefile.am which are required for xfce4 xdt-autogen tool, which when run in the source directory will generate the appropriate make and configure files.
***************
* Makefile.am *
***************
SUBDIRS = \
panel-plugin \
po
AUTOMAKE_OPTIONS = \
1.8 \
dist-bzip2
*****************
* configure.ac *
*****************
dnl Version information
m4_define([my_example_version_major], [1])
m4_define([my_example_version_minor], [3])
m4_define([my_example_version_micro], [0])
m4_define([my_example_version], [my_example_version_major().my_example_version_minor().my_example_version_micro()])
dnl Initialize autoconf
AC_COPYRIGHT([Copyright (c) 2013
Example <bug#example.org>])
AC_INIT([xfce4-my_example-plugin], [my_example_version()], [bug#example.org])
AC_PREREQ([2.50])
dnl Initialize automake
AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar])
AM_CONFIG_HEADER([config.h])
AM_MAINTAINER_MODE()
dnl Check for basic programs
AC_PROG_CC()
AC_PROG_LD()
AC_PROG_INSTALL()
AC_PROG_INTLTOOL()
AC_PROG_LIBTOOL()
AM_PROG_CC_C_O()
dnl Check for standard headers
AC_HEADER_STDC()
AC_CHECK_HEADERS([string.h fcntl.h errno.h sys/socket.h netdb.h \
netinet/in.h sys/types.h time.h unistd.h stdio.h \
sys/stat.h stddef.h stdlib.h netinet/in.h])
dnl Check for i18n support
XDT_I18N([])
dnl Check for required packages
XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.6.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.90.2])
XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.90.2])
XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.99.1])
dnl Check for debugging support
XDT_FEATURE_DEBUG()
AC_OUTPUT([
Makefile
po/Makefile.in
panel-plugin/Makefile
])
****************************
* panel-plugin/Makefile.am *
****************************
INCLUDES = \
-I$(top_srcdir) \
-DTHEMESDIR=\"$(datadir)/xfce4/my_example/icons\" \
-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
-DG_LOG_DOMAIN=\"my_example\"
plugin_PROGRAMS = \
xfce4-my_example-plugin
plugindir = $(libexecdir)/xfce4/panel-plugins
xfce4_my_example_plugin_SOURCES = \
my_example_dat.h \
my_example_func.h \
my_example_images.h \
my_example_applet.c \
my_example.c \
my_example_processdata.c \
my_example_menu.c
xfce4_my_example_plugin_CFLAGS = \
$(LIBXFCE4PANEL_CFLAGS) \
$(LIBXFCEGUI4_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(GTK_CFLAGS)
xfce4_my_example_plugin_LDADD = \
$(LIBXFCE4PANEL_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
$(LIBXFCEGUI4_LIBS) \
$(GTK_LIBS)
desktopdir = $(datadir)/xfce4/panel-plugins
desktop_DATA = \
my_example.desktop
#INTLTOOL_DESKTOP_RULE#
EXTRA_DIST = \
my_example.desktop.in
CLEANFILES = \
$(desktop_DATA)
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
I do have the right header files included in my source files in addition the source files compile fine before making the xfce4 related changes.
Makefile.am
xfce4_my_example_plugin_SOURCES = \
example_dat.h \
example_func.h \
example_images.h \
example_applet.c \
example.c \
example_processdata.c \
example_menu.c
From example_applet.c which is the first source file entered. Originally I only had "xfce4_my_example_plugin_SOURCES = example_applet.c" since the rest would be found through that file. It gave the same error.
#include <gtk/gtk.h>
#include <glib-object.h>
#include <string.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfce4panel/xfce-panel-plugin.h>
#include <libxfce4panel/xfce-hvbox.h>
#include "example_dat.h" /* contains all structures */
#include "example_func.h" /* contains all function prototypes used in this program */
#include "example_images.h"
#include "example.c"
#include "example_processdata.c"
#include "example_menu.c"
/* register the xfce plugin */
XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(example_applet_fill);
It looks like I solved the problem. The build process for xfce is slightly different than what I am using to build the gnome panel applet.
For the gnome applet I use one source file to include all other source and header files.
In xfce it appears, after having looked over various plugin source trees, each source file includes the necessary headers, however none of the source files include other source files.
The fix was to not include any other source files at all and change each source file to include the header files.

Resources