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

Re: Linking a static library with -fPIC for flex

Manoj Srivastava writes ("Linking a static library with -fPIC for flex"):
>         I was initially going to just provide libfl.a with position
>  independent code, which would have prevented the FTBS breakage for
>  scanner containing shared libraries, at the expense of a register
>  lost for binaries that were otherwise statically linked, and perhaps
>  slower execution speeds. When I broached this on IRC, people
>  commented that I could provide libfl_pic.a in addition to libfl.a ,
>  but compile them both with -fPIC, and transition back at some later
>  point to having a non position independent static libfl.a

I think this latter is the right approach.

>         Then I realized I was falling into the trap of preferring
>  convenience to correctness; the right thing to identify and fix
>  packages building shared objects linked to non relocatable code. So,
>  now these packages can link to  libfl_pic.a, and binaries can
>  continue to link with  libfl.a.

No, you were `falling' into the `trap' of providing a sensible
transition plan.  Backporters and luddites everywhere will thank you
if you don't break things when you don't need to.


Reply to: