Page MenuHomeFreeBSD

libc: add execvpe to weak symbol as gnu libc does
AcceptedPublic

Authored by aokblast on Wed, Apr 9, 1:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 19, 5:17 AM
Unknown Object (File)
Thu, Apr 17, 2:46 AM
Unknown Object (File)
Sun, Apr 13, 11:10 AM
Unknown Object (File)
Sat, Apr 12, 4:42 PM
Unknown Object (File)
Sat, Apr 12, 2:16 PM
Unknown Object (File)
Sat, Apr 12, 12:27 PM
Unknown Object (File)
Sat, Apr 12, 11:27 AM
Unknown Object (File)
Sat, Apr 12, 11:26 AM
Subscribers

Details

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 63470
Build 60354: arc lint + arc unit

Event Timeline

Why? Why does glibc do this?

jrm added a subscriber: jrm.

I think that the proper fix in line with the existing code is to use namespace.h to mangle execvpe reference in libc.

Use namespace.h instead of waek alias

The bear problem still fixed but we are unable to intercept the execvpe call as it is replaced with _execvpe.

In D49733#1134224, @kib wrote:

I think that the proper fix in line with the existing code is to use namespace.h to mangle execvpe reference in libc.

brooks requested changes to this revision.Fri, Apr 11, 2:53 AM

I think you need to bring the __weak_reference line back from the original change.

Using _execvpe is consistent, but perhaps it should be __libc_execvpe. The general _<foo> model is a remnant of libc_r and should perhaps be removed at some point.

lib/libc/gen/Symbol.map
460 ↗(On Diff #153445)

You can't remove previously exported public symbols.

lib/libc/gen/exec.c
301

Remove

lib/libc/include/libc_private.h
357 ↗(On Diff #153445)

Should not be required.

lib/libc/include/namespace.h
64–66

White space is wrong and touching the execve line is bug.

More importantly, you're missing a matching un-namespace.h change.

This revision now requires changes to proceed.Fri, Apr 11, 2:53 AM

You still need to add a an #undef execvpe line to un-namespace.h and then you shouldn't need the libc_private.h entry. The point of namespace.h/un-namespace.h is that the declarations are impacted by the macro so the execvpe declaration in unistd.h becomes an __libc_execvpe declaration which you can then use.

This revision is now accepted and ready to land.Thu, Apr 17, 4:47 PM
lib/libc/include/namespace.h
65

If you changed the original symbol name, why the namespacing is still kept in the patch?