On Mon, Nov 11, 2019 at 07:59:43AM -0800, Khem Raj wrote:
> On Mon, 2019-11-11 at 05:04 -0800, Andre McCurdy wrote:
> > 
> > With this merged, we can also drop the hack to force the sqlite
> > static
> > lib to be PIC:
> > 
> >   
> > https://git.openembedded.org/openembedded-core/commit/?id=6a58e12d19c539deac9e90679a68438497a42fa4
> That would be good but a caution is that if pseudo is just one usecase
> here which brought this issue forward, since we use PIE by default this
> would come up elsewhere too

The only usecase for building a static library as PIC I am aware of is 
when you want to link the static library into a shared library.

Usually linking a static library into a shared library is a bug and
the link error is preferable since you actually intended to link
with the shared library (the linker automatically uses a static
library when it can't find a shared library).

There are rare exceptions when this is done intentionally.
Linking a static libsqlite3.a into libpseudo.so was such an exception.

Whether the non-PIC code is PIE or not does not make a difference.



       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

Openembedded-core mailing list

Reply via email to