[Date Prev][Date Next] [Chronological] [Thread] [Top]

Problems building LDAP with gcc/Linux

First of all, kudos to the openldap project.  I'm a big LDAP fan, and am

glad to see this project happen.  Open source is the only way to do it.

Now, the bugs ... I've built LDAP many times, in many different
environments, usually without any problems.  I just downloaded
openldap-1-0.tgz and have built it on my Linux machine.  There
are some problems that I've discovered through working with
the UofM source (version 3.3) - most significantly, LDAP won't
build with gcc unless you go into the Makefile (Make-common)
and add '-fwritable-strings' to the CFLAGS:

   EXTRACFLAGS=-O -g -fwritable-strings
    EXTRACFLAGS?=-g -fwritable-strings
    # Passed to every link (ld).

There are some areas in the code where the compiler deems
various strings to be read-only, and the code then tries to modify
them (mostly in the area where the config files are parsed).  Without
adding -fwritable-strings to the compiler options, 'make tests' fails
miserably (only on Linux - on SGI IRIX or Solaris it doesn't seem
to be a problem).

I spent a few hours with a debugger chasing this down.  I'm not sure
why others aren't seeing this in Linux (maybe they are), but with 2
machines, one running Redhat 5.0, and the other RedHat 5.1, and
with the latest source from openldap, this is what happens.

Also, the first time I ran 'make' some of the libs didn't build which
also caused problems.  I did 'make veryclean', and now seem to be
able to build from scratch just fine ( as long as the
-fwritable-strings option is included).
Not sure what happened there.


Mick Oyer         mailto:mick@wamnet.com
WAM!NET, Inc.     http://www.wamnet.com