[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    -nostartfiles ?
From:       Rik Hemsley <rik () kde ! org>
Date:       2000-05-01 16:53:57
[Download RAW message or body]

I'm trying to rewrite the app-starting indication code to use the method
that SCWM and xalf use, which is more robust. There's a small problem
with the linking though...

The idea is that a shared library that overrides XMapWindow() is made,
and LD_PRELOAD is used to ensure this is linked at runtime.

I need to override _init() too, so that the real version of XMapWindow()
can be saved - once the overridden XMapWindow() is finished doing its
work, it calls the original version.

Unfortunately, _init() is already defined of course. I think the correct
way to sort it out it to pass -nostartfiles in for gcc's link phase, but
adding it to LDFLAGS in the Makefile.am doesn't seem to work.

This is what happens when it links:

/bin/sh ../libtool --mode=link gcc  -W -Wall -Os -pipe -fno-rtti -fno-exceptions -s \
-o libkrunwatch.la -rpath /x/kde/lib -ldl -nostartfiles krunwatch.lo   mkdir .libs
rm -fr .libs/libkrunwatch.la .libs/libkrunwatch.* .libs/libkrunwatch.*
(cd . && ln -s krunwatch.lo krunwatch.o)
g++ -shared  krunwatch.lo  -ldl -lc  -Wl,-soname -Wl,libkrunwatch.so.0 -o \
                .libs/libkrunwatch.so.0.0.0
krunwatch.lo: In function `_init':
krunwatch.lo(.text+0x0): multiple definition of `_init'
/usr/lib/crti.o(.init+0x0): first defined here

Any idea how to get it to pass that -nostartfiles through ? I think it's
possible to get libtool to do it automatically (and using whatever is
the portable equivalent) on its own, but I can't see how.

xalf seems to manage to get libtool to pass the flag, but I can't see
how it's doing it.

Cheers,
Rik


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic