diff options
-rw-r--r-- | doc/src/sgml/dfunc.sgml | 26 | ||||
-rw-r--r-- | src/makefiles/Makefile.linux | 7 | ||||
-rw-r--r-- | src/makefiles/Makefile.netbsd | 4 | ||||
-rw-r--r-- | src/makefiles/Makefile.openbsd | 4 |
4 files changed, 15 insertions, 26 deletions
diff --git a/doc/src/sgml/dfunc.sgml b/doc/src/sgml/dfunc.sgml index 8e6c95d15c5..4b90c8b3631 100644 --- a/doc/src/sgml/dfunc.sgml +++ b/doc/src/sgml/dfunc.sgml @@ -61,10 +61,10 @@ <listitem> <para> The compiler flag to create <acronym>PIC</acronym> is - <option>-fpic</option>. To create shared libraries the compiler + <option>-fPIC</option>. To create shared libraries the compiler flag is <option>-shared</option>. <programlisting> -gcc -fpic -c foo.c +gcc -fPIC -c foo.c gcc -shared -o foo.so foo.o </programlisting> This is applicable as of version 3.0 of @@ -80,14 +80,14 @@ gcc -shared -o foo.so foo.o <para> The compiler flag of the system compiler to create <acronym>PIC</acronym> is <option>+z</option>. When using - <application>GCC</application> it's <option>-fpic</option>. The + <application>GCC</application> it's <option>-fPIC</option>. The linker flag for shared libraries is <option>-b</option>. So: <programlisting> cc +z -c foo.c </programlisting> or: <programlisting> -gcc -fpic -c foo.c +gcc -fPIC -c foo.c </programlisting> and then: <programlisting> @@ -122,13 +122,11 @@ ld -shared -o foo.so foo.o <listitem> <para> The compiler flag to create <acronym>PIC</acronym> is - <option>-fpic</option>. On some platforms in some situations - <option>-fPIC</option> must be used if <option>-fpic</option> - does not work. Refer to the GCC manual for more information. + <option>-fPIC</option>. The compiler flag to create a shared library is <option>-shared</option>. A complete example looks like this: <programlisting> -cc -fpic -c foo.c +cc -fPIC -c foo.c cc -shared -o foo.so foo.o </programlisting> </para> @@ -155,12 +153,12 @@ cc -bundle -flat_namespace -undefined suppress -o foo.so foo.o <listitem> <para> The compiler flag to create <acronym>PIC</acronym> is - <option>-fpic</option>. For <acronym>ELF</acronym> systems, the + <option>-fPIC</option>. For <acronym>ELF</acronym> systems, the compiler with the flag <option>-shared</option> is used to link shared libraries. On the older non-ELF systems, <literal>ld -Bshareable</literal> is used. <programlisting> -gcc -fpic -c foo.c +gcc -fPIC -c foo.c gcc -shared -o foo.so foo.o </programlisting> </para> @@ -173,10 +171,10 @@ gcc -shared -o foo.so foo.o <listitem> <para> The compiler flag to create <acronym>PIC</acronym> is - <option>-fpic</option>. <literal>ld -Bshareable</literal> is + <option>-fPIC</option>. <literal>ld -Bshareable</literal> is used to link shared libraries. <programlisting> -gcc -fpic -c foo.c +gcc -fPIC -c foo.c ld -Bshareable -o foo.so foo.o </programlisting> </para> @@ -190,7 +188,7 @@ ld -Bshareable -o foo.so foo.o <para> The compiler flag to create <acronym>PIC</acronym> is <option>-KPIC</option> with the Sun compiler and - <option>-fpic</option> with <application>GCC</>. To + <option>-fPIC</option> with <application>GCC</>. To link shared libraries, the compiler option is <option>-G</option> with either compiler or alternatively <option>-shared</option> with <application>GCC</>. @@ -200,7 +198,7 @@ cc -G -o foo.so foo.o </programlisting> or <programlisting> -gcc -fpic -c foo.c +gcc -fPIC -c foo.c gcc -G -o foo.so foo.o </programlisting> </para> diff --git a/src/makefiles/Makefile.linux b/src/makefiles/Makefile.linux index 52bf0b1e2ba..f4f091caef5 100644 --- a/src/makefiles/Makefile.linux +++ b/src/makefiles/Makefile.linux @@ -1,15 +1,14 @@ AROPT = crs + export_dynamic = -Wl,-E # Use --enable-new-dtags to generate DT_RUNPATH instead of DT_RPATH. # This allows LD_LIBRARY_PATH to still work when needed. rpath = -Wl,-rpath,'$(rpathdir)',--enable-new-dtags + DLSUFFIX = .so -ifeq "$(findstring sparc,$(host_cpu))" "sparc" CFLAGS_SL = -fPIC -else -CFLAGS_SL = -fpic -endif + # Rule for building a shared library from a single .o file %.so: %.o diff --git a/src/makefiles/Makefile.netbsd b/src/makefiles/Makefile.netbsd index 31a52601aff..43841c15973 100644 --- a/src/makefiles/Makefile.netbsd +++ b/src/makefiles/Makefile.netbsd @@ -9,11 +9,7 @@ endif DLSUFFIX = .so -ifeq ($(findstring sparc,$(host_cpu)), sparc) CFLAGS_SL = -fPIC -DPIC -else -CFLAGS_SL = -fpic -DPIC -endif # Rule for building a shared library from a single .o file diff --git a/src/makefiles/Makefile.openbsd b/src/makefiles/Makefile.openbsd index 7bf54933090..d8fde49d5c8 100644 --- a/src/makefiles/Makefile.openbsd +++ b/src/makefiles/Makefile.openbsd @@ -7,11 +7,7 @@ endif DLSUFFIX = .so -ifeq ($(findstring sparc,$(host_cpu)), sparc) CFLAGS_SL = -fPIC -DPIC -else -CFLAGS_SL = -fpic -DPIC -endif # Rule for building a shared library from a single .o file |