This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[PATCH, libiberty] Fix PR63758 by using the _NSGetEnviron() API on Darwin.


Hi,

This is mostly Roland's patch with one extra case added by me plus I moved the new header to include/ as suggested in c#7 of the PR since there are other users for it in the compiler.

==

On Darwin platforms, when referenced from the main executable, it's permitted to access *_environ directly.  When the environment is required from a shared library then the _NSGetEnviron() API should be used.  Since libiberty is used from shared libraries (such as libcc1) this mechanism should be applied here.

OK for trunk and active branches?
Iain

include/

	Roland McGrath  <roland@gnu.org>

	PR other/63758
	* environ.h: New file.

libiberty/

	Roland McGrath  <roland@gnu.org>
	Iain Sandoe  <iain@codesourcery.com>

	PR other/63758
	* pex-unix.c: Obtain the environment interface from settings in environ.h
	rather than in-line code.  Update copyright date.
	* setenv.c: Likewise.
	* xmalloc.c: Likewise.


 

Attachment: pr63758-libiberty-environ.txt
Description: Text document


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