Hi Hackers,
I'm attempting to build the Fiasco.OC kernel including several additional files. When I attempt to make, I get endless complaints about multiple definitions of functions. The catch is, every single file I have added has a unique include guard...
A few things I want to check:
My files are written in standard c++ format, not Preprocess compatible
format. E.g. I make use of namespaces. I haven't added the files to any modules lists / Makerules files, so my thinking is that I'm just trying to link with these files but not use any of their features (for testing purposes). My impression was that namespace usage would be tolerated for files used thus: Preprocess doesn't complain.
The c++ preprocessor is still run, correct? I don't see include guards
in kernel source files: are these generated by Preprocess, or simply not needed?
Specifically, the errors start appearing at "==> Archiving into
jdb_compound.o," and they complain about finding a definition of a function in my source file which was already defined in an object file, e.g.:
jdb-ia32-amd64.o: In function `prio_queue_rel::query_iterator_priority__element::next()': /home/bryce/parsnip/fiasco_modified_src/recovery/src/kernel/fiasco/src/kern/R_test11impl.cpp:499: multiple definition of `prio_queue_rel::query_iterator_priority__element::next()' jdb.o:/home/bryce/parsnip/fiasco_modified_src/recovery/src/kernel/fiasco/src/kern/R_test11impl.cpp:499: first defined here
I know that's not a lot to go on, but I'm not sure what else would be useful. Please let me know what I do to help you help me...
Thank you! --Bryce
To follow up,
it appears that jdb.o is the source of all the name conflicts. An nm dump gives all of the offending duplicated definitions as fully defined function objects:
0000000000000000 T _ZN14prio_queue_rel32query_iterator_priority__element15remove_and_nextEv 0000000000000000 T _ZN14prio_queue_rel32query_iterator_priority__element4nextEv 0000000000000000 T _ZN14prio_queue_rel32query_iterator_priority__elementC1EPNS_8relationERKNS_14tuple_priorityE 0000000000000000 T _ZN14prio_queue_rel32query_iterator_priority__elementC2EPNS_8relationERKNS_14tuple_priorityE 0000000000000000 T _ZN14prio_queue_rel33query_iterator___element_priority15remove_and_nextEv 0000000000000000 T _ZN14prio_queue_rel33query_iterator___element_priority4nextEv 0000000000000000 T _ZN14prio_queue_rel33query_iterator___element_priorityC1EPNS_8relationE 0000000000000000 T _ZN14prio_queue_rel33query_iterator___element_priorityC2EPNS_8relationE 0000000000000000 T _ZN14prio_queue_rel8relation13unsafe_removeERKNS_22tuple_element_priorityE 0000000000000000 T _ZN14prio_queue_rel8relation5queryERKNS_13tuple_elementERNS_14tuple_priorityE 0000000000000000 T _ZN14prio_queue_rel8relation5queryERKNS_14tuple_priorityERNS_32query_iterator_priority__elementE 0000000000000000 T _ZN14prio_queue_rel8relation5queryERNS_33query_iterator___element_priorityE 0000000000000000 T _ZN14prio_queue_rel8relation6insertERKNS_22tuple_element_priorityE 0000000000000000 T _ZN14prio_queue_rel8relation6removeERKNS_13tuple_elementE 0000000000000000 T _ZN14prio_queue_rel8relation6updateERKNS_13tuple_elementERKNS_14tuple_priorityE
The peculiar thing here is that the rest of the objects in the dump seem to be explicitly in jdb-labeled directories (instead of the kern directory), or are left undefined (printf, etc.).
So why does jdb.o pick up my definitions from the kern directory? Should I look into putting these files in preprocess format?
Thanks!
On Tue, 2011-08-02 at 12:15 -0700, Bryce CR wrote:
Hi Hackers,
I'm attempting to build the Fiasco.OC kernel including several additional files. When I attempt to make, I get endless complaints about multiple definitions of functions. The catch is, every single file I have added has a unique include guard...
A few things I want to check:
My files are written in standard c++ format, not Preprocess compatible
format. E.g. I make use of namespaces. I haven't added the files to any modules lists / Makerules files, so my thinking is that I'm just trying to link with these files but not use any of their features (for testing purposes). My impression was that namespace usage would be tolerated for files used thus: Preprocess doesn't complain.
The c++ preprocessor is still run, correct? I don't see include guards
in kernel source files: are these generated by Preprocess, or simply not needed?
Specifically, the errors start appearing at "==> Archiving into
jdb_compound.o," and they complain about finding a definition of a function in my source file which was already defined in an object file, e.g.:
jdb-ia32-amd64.o: In function `prio_queue_rel::query_iterator_priority__element::next()': /home/bryce/parsnip/fiasco_modified_src/recovery/src/kernel/fiasco/src/kern/R_test11impl.cpp:499: multiple definition of `prio_queue_rel::query_iterator_priority__element::next()' jdb.o:/home/bryce/parsnip/fiasco_modified_src/recovery/src/kernel/fiasco/src/kern/R_test11impl.cpp:499: first defined here
I know that's not a lot to go on, but I'm not sure what else would be useful. Please let me know what I do to help you help me...
Thank you! --Bryce
Hi,
On Tue Aug 02, 2011 at 15:30:11 -0700, Bryce CR wrote:
0000000000000000 T _ZN14prio_queue_rel8relation6removeERKNS_13tuple_elementE 0000000000000000 T _ZN14prio_queue_rel8relation6updateERKNS_13tuple_elementERKNS_14tuple_priorityE
The peculiar thing here is that the rest of the objects in the dump seem to be explicitly in jdb-labeled directories (instead of the kern directory), or are left undefined (printf, etc.).
So why does jdb.o pick up my definitions from the kern directory? Should I look into putting these files in preprocess format?
Are you trying to include just header files or also files which leave something in the resulting object?
In src/lib, there are some external libs included, maybe you want to look there to see if this way works better for you.
I'm attempting to build the Fiasco.OC kernel including several additional files. When I attempt to make, I get endless complaints about multiple definitions of functions. The catch is, every single file I have added has a unique include guard...
A few things I want to check:
My files are written in standard c++ format, not Preprocess compatible
format. E.g. I make use of namespaces. I haven't added the files to any modules lists / Makerules files, so my thinking is that I'm just trying to link with these files but not use any of their features (for testing purposes). My impression was that namespace usage would be tolerated for files used thus: Preprocess doesn't complain.
The c++ preprocessor is still run, correct? I don't see include guards
in kernel source files: are these generated by Preprocess, or simply not needed?
Specifically, the errors start appearing at "==> Archiving into
jdb_compound.o," and they complain about finding a definition of a function in my source file which was already defined in an object file, e.g.:
jdb-ia32-amd64.o: In function `prio_queue_rel::query_iterator_priority__element::next()': /home/bryce/parsnip/fiasco_modified_src/recovery/src/kernel/fiasco/src/kern/R_test11impl.cpp:499: multiple definition of `prio_queue_rel::query_iterator_priority__element::next()' jdb.o:/home/bryce/parsnip/fiasco_modified_src/recovery/src/kernel/fiasco/src/kern/R_test11impl.cpp:499: first defined here
Adam
l4-hackers@os.inf.tu-dresden.de