This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] memset: fix define usage for shared libs


On Wed, Apr 4, 2012 at 9:26 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> The proper define to check "am I in a shared lib" is "SHARED", not "PIC".
> The two new memset_chk functions incorrectly depend on "PIC".
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>
> 2011-02-22 ?Mike Frysinger ?<vapier@gentoo.org>
>
> ? ? ? ?* sysdeps/i386/i686/memset_chk.S: Change PIC to SHARED.
> ? ? ? ?* sysdeps/x86_64/memset_chk.S: Likewise.

Please check this in.

It's not correct to use PIC, you can conceivably compile all the
static libraries as PIC code for use with PIEs.

However, please re-read Ulrich's comments. His original complaint is valid.

Here goes a story which was told to me by someone who mentored me:
~~~
It's the first day of class at school, and your eager to get in there
and learn something new. The teach starts talking about all the things
you'll be learning and finally asks the question "What is your job
here in this class?" An eager students raises her hand and says "To
learn!" To which the teacher smiles and says "No, it's to make it easy
for the person grading you to give you an A."
~~~

You need to make it easy for the reviewer to give you an A.

Tell us about your users, and your use case, and why something which
*normally* works (even if it's not correct), no longer works.

That way we can *own* your problem and in the future when writing code
we'll remember why we need to be precise about PIC vs. SHARED.

Does that make sense?

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]