Fwd: Multiple symbols defined in object files that should not be there.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---------- Forwarded message ---------
From: Jonathan Wakely <jwakely.gcc@xxxxxxxxx>
Date: Fri, Apr 7, 2023 at 1:54 AM
Subject: Re: Multiple symbols defined in object files that should not be
there.
To: Steve Thompson <susurrus.of.qualia@xxxxxxxxx>


Please reply to the list, not just to me.

The preprocessor is dumb, it doesn't do anything complicated. If platform.h
doesn't include microsecond_time.h there must be an include guard stopping
it.

If #undef MICROSECOND_TIME_H doesn't change anything, maybe that's not the
name of the include guard.

None of those is a gcc problem, it's just your code not working how you
want it to.

--------------------------------------------------

Your suggestion to use "-E and -dD" was what I needed to find the
embarassing mistake that caused it all.  FTR I had guard clauses in the
microsecond_time.c file as well as the .h file for some odd reason.  Not a
recent change it seems and my brain was fooled and mostly eliminated those
clauses from my perception, possibly because they are present about half
the time I'm editing any given file and are more-or-less invisible.

I still have the problem that the compiler is generating code in some
object modules for an inline function that is not referenced in the
individual .c files.  Only 7 of 15 source files.  Some of the affected
source files are trivial while others are reasonably complex.

I defined the offending function as "static inline" and tried adding
-fno-keep-inline-functions, but there was no change.  Fooling aroung with
related options had no effect.

>From my understanding, GCC simply shouldn't be marking an inline function
for inclusion in an object file unless it is referenced in the source file
it is compiling.  There simply no instances where apool_init_freelist() is
written in any of the .c files; it is only defined in the one .h file.  So
what on Earth is going on?

For the moment I'm going to hope that space aliens beam inspiration
directly into my brain before it melts completely.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux