# Build shared libs with --enable-auto-image-base

**URL:** <https://www.ruby-forum.com/t/build-shared-libs-with-enable-auto-image-base/86994>\
**Category:** Ruby\
**Created:** [February 27, 2007, 1:20pm UTC](https://www.ruby-forum.com/t/build-shared-libs-with-enable-auto-image-base/86994 "2007-02-27T13:20:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Corinna\_Vinschen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/50afbb/32.png) [@Corinna\_Vinschen](https://www.ruby-forum.com/u/Corinna_Vinschen)\
**Post date:** [February 27, 2007, 1:20pm UTC](https://www.ruby-forum.com/t/build-shared-libs-with-enable-auto-image-base/86994/1 "2007-02-27T13:20:40Z")

</div>

Hi,

in the Cygwin net distribution I started to build the ruby package  
with the additional -Wl,–enable-auto-image-base flag in the DLDFLAGS  
Makefile variable. The idea is to avoid the neccessity to rebase the  
shared libs as much as possible. I’m wondering if you’d like to apply  
the below patch to the ruby configure.in file, which accomplishes this  
behaviour.

— configure.in.ORIG 2007-02-27 12:57:20.012314100 +0100  
+++ configure.in 2007-02-27 11:48:54.848883000 +0100  
@@ -1030,7 +1030,7 @@ if test “$with\_dln\_a\_out” != yes; then  
rb\_cv\_dlopen=yes;;  
cygwin\*|mingw\*) : ${LDSHARED="${CC} -shared -s"}  
XLDFLAGS="$XLDFLAGS -Wl,–stack,0x02000000"

- 

```
 DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-import,--export-all"

```

- 

```
 DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base 

```

-Wl,–enable-auto-import,–export-all"  
: ${LIBPATHENV=""}  
rb\_cv\_dlopen=yes ;;  
hiuxmpp) : ${LDSHARED=‘ld -r’} ;;

Btw., what I don’t quite understand is this: What is the cygwin  
subdirectory with the GNUMakefile.in for? It uses old and deprecated  
methods like using dllwrap to create shared libs on Cygwin. However, I  
never used it to build the Cygwin net distro ruby package, which always  
worked fine. So I’m wondering if the cygwin subdir and the funny  
GNUMakefile.in could just be removed.

Thanks,  
Corinna

---

<div class="post-metadata">

**Author:** ![Corinna\_Vinschen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/50afbb/32.png) [@Corinna\_Vinschen](https://www.ruby-forum.com/u/Corinna_Vinschen)\
**Post date:** [February 27, 2007, 1:21pm UTC](https://www.ruby-forum.com/t/build-shared-libs-with-enable-auto-image-base/86994/2 "2007-02-27T13:21:40Z")

</div>

Corinna Vinschen wrote:

> Btw., what I don’t quite understand is this: What is the cygwin  
> subdirectory with the GNUMakefile.in for? It uses old and deprecated  
> methods like using dllwrap to create shared libs on Cygwin. However, I  
> never used it to build the Cygwin net distro ruby package, which always  
> ^^^^  
> but the normal Makefile  
> instead

> worked fine. So I’m wondering if the cygwin subdir and the funny  
> GNUMakefile.in could just be removed.

Corinna
