Thread: Build 8.2 with an old linker

Build 8.2 with an old linker

From
"Thorkil Olesen"
Date:
I could not build Postgresql 8.2 with an old linker. I complained about a
wrong syntax of version-script when linking libpq.

I solved it by adding an arbitrary version-name to the script, and
everything seems to work now.

Is it really that simple? If it is, I would suggest to make the change in
the main source. I know that few use that old systems, but as long as
compatibility can be retained, there is no need to brake it.

[root@linux lib]# gcc --version
2.96
[root@linux lib]# ld --version
GNU ld 2.10.91
Copyright 2001 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
  Supported emulations:
   elf_i386
   i386linux
   elf_i386_glibc21

------ PATCH START HERE -------

--- postgresql-8.2.0/src/interfaces/libpq/Makefile.old  Fri Dec 15 15:57:52
2006
+++ postgresql-8.2.0/src/interfaces/libpq/Makefile      Fri Dec 15 15:58:53
2006
@@ -140,7 +140,7 @@
 $(shlib): exports.list

 exports.list: exports.txt
-       echo '{ global:' >$@
+       echo 'VERSION { global:' >$@
        $(AWK) '/^[^#]/ {printf "%s;\n",$$1}' $< >>$@
        echo ' local: *; };' >>$@

------ PATCH END HERE -------

--
Thorkil Olesen,
Hanstholm, Denmark.


Re: Build 8.2 with an old linker

From
Tom Lane
Date:
"Thorkil Olesen" <thorkil@pip.dknet.dk> writes:
> --- postgresql-8.2.0/src/interfaces/libpq/Makefile.old  Fri Dec 15 15:57:52
> 2006
> +++ postgresql-8.2.0/src/interfaces/libpq/Makefile      Fri Dec 15 15:58:53
> 2006
> @@ -140,7 +140,7 @@
>  $(shlib): exports.list

>  exports.list: exports.txt
> -       echo '{ global:' >$@
> +       echo 'VERSION { global:' >$@
>         $(AWK) '/^[^#]/ {printf "%s;\n",$$1}' $< >>$@
>         echo ' local: *; };' >>$@

Done, thanks for the suggestion.

            regards, tom lane

Re: Build 8.2 with an old linker

From
Tom Lane
Date:
"Thorkil Olesen" <thorkil@pip.dknet.dk> writes:
>  exports.list: exports.txt
> -       echo '{ global:' >$@
> +       echo 'VERSION { global:' >$@

Actually ... on second look, doesn't that change the semantics?

We are not trying to establish a versioned API here, only restrict
symbol visibility.  I think if we do the above we just created a
versioned API with a version name of "VERSION", which does not seem
like a good idea.

            regards, tom lane

Re: Build 8.2 with an old linker

From
Thorkil Olesen
Date:
Den 28/12/2006 kl. 0.57 skrev Tom Lane:

> "Thorkil Olesen" <thorkil@pip.dknet.dk> writes:
>>  exports.list: exports.txt
>> -       echo '{ global:' >$@
>> +       echo 'VERSION { global:' >$@
>
> Actually ... on second look, doesn't that change the semantics?
>
> We are not trying to establish a versioned API here, only restrict
> symbol visibility.  I think if we do the above we just created a
> versioned API with a version name of "VERSION", which does not seem
> like a good idea.

You might be right.

I'd think that if the name will never be changed, it would mean the
same thing, but I don't know really. I just know that it solved my
build-problem, and I wanted to share that information with the list.
(Probably some more meaningful name than 'VERSION' could be chosen.)

Thank you for the comments.

Best regards, Thorkil.

--
Thorkil Olesen, Hanstholm
Tel. +45 97 96 00 19