[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Qemacs-devel] [PATCH] attribute "used"
From: |
Charlie Gordon |
Subject: |
RE: [Qemacs-devel] [PATCH] attribute "used" |
Date: |
Sat, 14 May 2005 10:21:49 +0200 |
Hi Flavien,
I merged your patch in the CVS tree.
I wonder if a better fix should not just be to remove the static keyword on
the pointers themselves.
Also I am comtemplating an alternate method for platforms where the
__attribute__ segment stuff is not supported, where the list of module
initialization routines would be constructed at make time by greping the
object files for certain symbols. This would work on most platforms, but
would cause problems if the symbols are mangled beyond recognition. It
would require a separate fix for dynamic modules.
Chqrlie.
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf Of
> Flavien Lebarbe
> Sent: Friday, May 13, 2005 12:10 AM
> To: address@hidden
> Subject: [Qemacs-devel] [PATCH] attribute "used"
>
>
> Hi,
>
>
> I'm using qemacs on linux Fedora Core 3. Compiler is gcc 3.4.3.
>
> Without the attached patch, qemacs compiles cleanly, but all I
> get is: "No suitable display found, exiting"
>
> The reason is that the functions defined with qe_module_init()
> are never called. I found out I need to add "used" attribute
> here.
>
> Pasting from the info of gcc 3.4.3 :
> `used'
> This attribute, attached to a function, means that code must
> be emitted for the function even if it appears that the
> function is not referenced. This is useful, for example,
> when the function is referenced only in inline assembly.
>
> Given this, I'd say we need both "used" and "unused" !!!
>
> Attached is a patch that implements this. I'm not sure if this is
> the right fix or not. It just passes the "it works for me"
> test with gcc 3.4.3. It also compiles cleanly with egcs-2.91.66
> (although I had to disable x11 support because of missing libs).
>
>
> Flavien.
>