<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Support/Unix/DynamicLibrary.inc, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[Support][Cygwin] Fix handling of Process symbol lookup. (#143072)</title>
<updated>2025-06-09T19:19:37+00:00</updated>
<author>
<name>jeremyd2019</name>
<email>github@jdrake.com</email>
</author>
<published>2025-06-09T19:19:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d659364295f6f0c41535a0c98c958cb4c896cc62'/>
<id>d659364295f6f0c41535a0c98c958cb4c896cc62</id>
<content type='text'>
In Unix/DynamicLibrary.inc, it was already known that Cygwin required
use of `RTLD_DEFAULT` as the `Handle` parameter to `DLSym` to search all
modules for a symbol. Unfortunately, RTLD_DEFAULT is defined as NULL, so
the existing checks of the `Process` handle meant `DLSym` would never be
called on Cygwin. Use the existing `&amp;Invalid` sentinel instead of
`nullptr` for the `Process` handle.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In Unix/DynamicLibrary.inc, it was already known that Cygwin required
use of `RTLD_DEFAULT` as the `Handle` parameter to `DLSym` to search all
modules for a symbol. Unfortunately, RTLD_DEFAULT is defined as NULL, so
the existing checks of the `Process` handle meant `DLSym` would never be
called on Cygwin. Use the existing `&amp;Invalid` sentinel instead of
`nullptr` for the `Process` handle.</pre>
</div>
</content>
</entry>
<entry>
<title>[CMake] Remove HAVE_DLFCN_H and HAVE_DLADDR (#123879)</title>
<updated>2025-01-22T16:15:10+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2025-01-22T16:15:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=58c6d440f8c24ef1532d12e50302e290e1907a87'/>
<id>58c6d440f8c24ef1532d12e50302e290e1907a87</id>
<content type='text'>
It is sufficient to just use `HAVE_DLOPEN`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is sufficient to just use `HAVE_DLOPEN`.</pre>
</div>
</content>
</entry>
<entry>
<title>[Support] Apply clang-format on .inc files. NFC.</title>
<updated>2022-11-26T14:36:43+00:00</updated>
<author>
<name>Alexandre Ganea</name>
<email>alex_toresh@yahoo.fr</email>
</author>
<published>2022-11-26T14:36:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f1aa7348d355a57cd9050f37860346bd82118573'/>
<id>f1aa7348d355a57cd9050f37860346bd82118573</id>
<content type='text'>
Apply clang-format on llvm/lib/Support/Windows/ and llvm/lib/Support/Unix/ since .inc files in these folders aren't picked up by default. Eventually we need to add this extension in the monorepo .clang-format file.

Differential Revision: https://reviews.llvm.org/D138714
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apply clang-format on llvm/lib/Support/Windows/ and llvm/lib/Support/Unix/ since .inc files in these folders aren't picked up by default. Eventually we need to add this extension in the monorepo .clang-format file.

Differential Revision: https://reviews.llvm.org/D138714
</pre>
</div>
</content>
</entry>
<entry>
<title>Update the file headers across all of the LLVM projects in the monorepo</title>
<updated>2019-01-19T08:50:56+00:00</updated>
<author>
<name>Chandler Carruth</name>
<email>chandlerc@gmail.com</email>
</author>
<published>2019-01-19T08:50:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2946cd701067404b99c39fb29dc9c74bd7193eb3'/>
<id>2946cd701067404b99c39fb29dc9c74bd7193eb3</id>
<content type='text'>
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
</pre>
</div>
</content>
</entry>
<entry>
<title>[DynamicLibrary] Fix build on musl libc</title>
<updated>2017-10-26T16:44:13+00:00</updated>
<author>
<name>Keno Fischer</name>
<email>keno@alumni.harvard.edu</email>
</author>
<published>2017-10-26T16:44:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1c43ad09650adcb66525f8e074e708691b3c841b'/>
<id>1c43ad09650adcb66525f8e074e708691b3c841b</id>
<content type='text'>
Summary:
On musl libc, stdin/out/err are defined as `FILE* const` globals,
and their address is not implicitly convertible to void *,
or at least gcc 6 doesn't allow it, giving errors like:

```
error: cannot initialize return object of type 'void *' with an rvalue of type 'FILE *const *' (aka '_IO_FILE *const *')
    EXPLICIT_SYMBOL(stderr);
    ^~~~~~~~~~~~~~~~~~~~~~~
```

Add an explicit cast to fix that problem.

Reviewers: marsupial, krytarowski, dim
Reviewed By: dim
Differential Revision: https://reviews.llvm.org/D39297

llvm-svn: 316672
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
On musl libc, stdin/out/err are defined as `FILE* const` globals,
and their address is not implicitly convertible to void *,
or at least gcc 6 doesn't allow it, giving errors like:

```
error: cannot initialize return object of type 'void *' with an rvalue of type 'FILE *const *' (aka '_IO_FILE *const *')
    EXPLICIT_SYMBOL(stderr);
    ^~~~~~~~~~~~~~~~~~~~~~~
```

Add an explicit cast to fix that problem.

Reviewers: marsupial, krytarowski, dim
Reviewed By: dim
Differential Revision: https://reviews.llvm.org/D39297

llvm-svn: 316672
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow clients to specify search order of DynamicLibraries.</title>
<updated>2017-07-12T21:22:45+00:00</updated>
<author>
<name>Frederich Munch</name>
<email>colsebas@hotmail.com</email>
</author>
<published>2017-07-12T21:22:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5fdd2cbae8d046707bb0cb1bb47d039a67f17a4a'/>
<id>5fdd2cbae8d046707bb0cb1bb47d039a67f17a4a</id>
<content type='text'>
Summary: Different JITs and other clients of LLVM may have different needs in how symbol resolution should occur.

Reviewers: v.g.vassilev, lhames, karies

Reviewed By: v.g.vassilev

Subscribers: pcanal, llvm-commits

Differential Revision: https://reviews.llvm.org/D33529

llvm-svn: 307849
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary: Different JITs and other clients of LLVM may have different needs in how symbol resolution should occur.

Reviewers: v.g.vassilev, lhames, karies

Reviewed By: v.g.vassilev

Subscribers: pcanal, llvm-commits

Differential Revision: https://reviews.llvm.org/D33529

llvm-svn: 307849
</pre>
</div>
</content>
</entry>
<entry>
<title>Close DynamicLibraries in reverse order they were opened.</title>
<updated>2017-06-05T16:26:58+00:00</updated>
<author>
<name>Frederich Munch</name>
<email>colsebas@hotmail.com</email>
</author>
<published>2017-06-05T16:26:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ad12580012765c2c6580000688b5166de3b1587d'/>
<id>ad12580012765c2c6580000688b5166de3b1587d</id>
<content type='text'>
Summary: Matches C++ destruction ordering better and fixes possible problems of loaded libraries having inter-dependencies.

Reviewers: efriedma, v.g.vassilev, chapuni

Reviewed By: efriedma

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D33652

llvm-svn: 304720
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary: Matches C++ destruction ordering better and fixes possible problems of loaded libraries having inter-dependencies.

Reviewers: efriedma, v.g.vassilev, chapuni

Reviewed By: efriedma

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D33652

llvm-svn: 304720
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix building DynamicLibrary.cpp with musl libc</title>
<updated>2017-06-05T11:22:18+00:00</updated>
<author>
<name>Dimitry Andric</name>
<email>dimitry@andric.com</email>
</author>
<published>2017-06-05T11:22:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f5d486f43d861f938f381d440a9a21383b3bb36f'/>
<id>f5d486f43d861f938f381d440a9a21383b3bb36f</id>
<content type='text'>
Summary:
The workaround added in rL301240 for stderr/out/in symbols being both
macros and globals is only necessary for glibc, and it does not compile
with musl libc. Alpine Linux has had the following fix for it:

https://git.alpinelinux.org/cgit/aports/plain/main/llvm4/llvm-fix-DynamicLibrary-to-build-with-musl-libc.patch

Adapt the fix in our DynamicLibrary.inc for Unix.

Reviewers: marsupial, chandlerc, krytarowski

Reviewed By: krytarowski

Subscribers: srhines, krytarowski, llvm-commits

Differential Revision: https://reviews.llvm.org/D33883

llvm-svn: 304707
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
The workaround added in rL301240 for stderr/out/in symbols being both
macros and globals is only necessary for glibc, and it does not compile
with musl libc. Alpine Linux has had the following fix for it:

https://git.alpinelinux.org/cgit/aports/plain/main/llvm4/llvm-fix-DynamicLibrary-to-build-with-musl-libc.patch

Adapt the fix in our DynamicLibrary.inc for Unix.

Reviewers: marsupial, chandlerc, krytarowski

Reviewed By: krytarowski

Subscribers: srhines, krytarowski, llvm-commits

Differential Revision: https://reviews.llvm.org/D33883

llvm-svn: 304707
</pre>
</div>
</content>
</entry>
<entry>
<title>fix build on Cygwin</title>
<updated>2017-05-05T16:08:22+00:00</updated>
<author>
<name>Nuno Lopes</name>
<email>nunoplopes@sapo.pt</email>
</author>
<published>2017-05-05T16:08:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8b66b00ecd04c3d37fcfa6bfd03595365c7efd30'/>
<id>8b66b00ecd04c3d37fcfa6bfd03595365c7efd30</id>
<content type='text'>
llvm-svn: 302246
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm-svn: 302246
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor DynamicLibrary so searching for a symbol will have a defined order and</title>
<updated>2017-04-27T16:55:24+00:00</updated>
<author>
<name>Frederich Munch</name>
<email>colsebas@hotmail.com</email>
</author>
<published>2017-04-27T16:55:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c1db8cf9c1ddf2a113312b81e467fcd5b6f30194'/>
<id>c1db8cf9c1ddf2a113312b81e467fcd5b6f30194</id>
<content type='text'>
libraries are properly unloaded when llvm_shutdown is called.

Summary:
This was mostly affecting usage of the JIT, where storing the library handles in
a set made iteration unordered/undefined. This lead to disagreement between the
JIT and native code as to what the address and implementation of particularly on
Windows with stdlib functions:

JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s
JIT: getenv("TEST") -&gt; "VALUE" // called msvcrt.dll, getenv
Native: getenv("TEST") -&gt; NULL // called ucrt.dll, getenv

Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows
not giving priority to the process' symbols as it did on Unix.

Reviewers: chapuni, v.g.vassilev, lhames

Reviewed By: lhames

Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits

Differential Revision: https://reviews.llvm.org/D30107

llvm-svn: 301562
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
libraries are properly unloaded when llvm_shutdown is called.

Summary:
This was mostly affecting usage of the JIT, where storing the library handles in
a set made iteration unordered/undefined. This lead to disagreement between the
JIT and native code as to what the address and implementation of particularly on
Windows with stdlib functions:

JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s
JIT: getenv("TEST") -&gt; "VALUE" // called msvcrt.dll, getenv
Native: getenv("TEST") -&gt; NULL // called ucrt.dll, getenv

Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows
not giving priority to the process' symbols as it did on Unix.

Reviewers: chapuni, v.g.vassilev, lhames

Reviewed By: lhames

Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits

Differential Revision: https://reviews.llvm.org/D30107

llvm-svn: 301562
</pre>
</div>
</content>
</entry>
</feed>
