BUG #14380: pg_config fails to build.

Started by Nels Frazierover 9 years ago4 messagesbugs
Jump to latest
#1Nels Frazier
hellkite500@gmail.com

The following bug has been logged on the website:

Bug reference: 14380
Logged by: Nels Frazier
Email address: hellkite500@gmail.com
PostgreSQL version: 9.2.18
Operating system: Red Hat Enterprise Linux Server release 6.4 (Santi
Description:

I am attempting a build on a RHEL 6.4 machine using gcc 4.4.7.

I get the following error during the build. I even tried without --prefix,
and the show_ldflags error still happens. I tried this in both postgresql
9.2.17 and 9.2.18 with no difference.

make -C pg_config all
make[3]: Entering directory
`/glade/p/work/nfrazie1/CI-WATER-tools/sources/postgresql-9.2.18/src/bin/pg_config'
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -I../../../src/include
-D_GNU_SOURCE
-DVAL_CONFIGURE="\"'--prefix=/glade/p/work/nfrazie1/CI-WATER-tools/'\""
-DVAL_CC="\"gcc\"" -DVAL_CPPFLAGS="\"-D_GNU_SOURCE\"" -DVAL_CFLAGS="\"-O2
-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
-Wendif-labels -Wmissing-format-attribute -Wformat-security
-fno-strict-aliasing -fwrapv\"" -DVAL_CFLAGS_SL="\"-fpic\""
-DVAL_LDFLAGS="\"-Wl,--as-needed
-Wl,-rpath,'/glade/p/work/nfrazie1/CI-WATER-tools/lib',--enable-new-dtags\""
-DVAL_LDFLAGS_EX="\"\"" -DVAL_LDFLAGS_SL="\"\"" -DVAL_LIBS="\"-lpgport -lz
-lreadline -lcrypt -lm \"" -c -o pg_config.o pg_config.c
pg_config.c: In function 'show_configure':
pg_config.c:239: error: 'prefix' undeclared (first use in this function)
pg_config.c:239: error: (Each undeclared identifier is reported only once
pg_config.c:239: error: for each function it appears in.)
pg_config.c:239: error: expected expression before '/' token
pg_config.c: In function 'show_ldflags':
pg_config.c:319: error: 'Wl' undeclared (first use in this function)
pg_config.c:319: error: 'as' undeclared (first use in this function)
pg_config.c:319: error: 'needed' undeclared (first use in this function)
make[3]: *** [pg_config.o] Error 1
make[3]: Leaving directory
`/glade/p/work/nfrazie1/CI-WATER-tools/sources/postgresql-9.2.18/src/bin/pg_config'
make[2]: *** [all-pg_config-recurse] Error 2
make[2]: Leaving directory
`/glade/p/work/nfrazie1/CI-WATER-tools/sources/postgresql-9.2.18/src/bin'
make[1]: *** [all-bin-recurse] Error 2
make[1]: Leaving directory
`/glade/p/work/nfrazie1/CI-WATER-tools/sources/postgresql-9.2.18/src'
make: *** [all-src-recurse] Error 2

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Nels Frazier (#1)
Re: BUG #14380: pg_config fails to build.

hellkite500@gmail.com writes:

I am attempting a build on a RHEL 6.4 machine using gcc 4.4.7.
I get the following error during the build.

[ scratches head... ] Weird. Evidently something is going wrong with
the quoting of those make variables; but the gcc command line looks
exactly as it should, AFAICT. Are you using a nonstandard shell, or
something other than the stock gcc installation?

A slightly far-fetched possibility is that you have a corrupted ccache
entry for this file. In a standard RHEL6 installation, "gcc" really
invokes "ccache gcc", so the lack of any mention of ccache in the given
command line doesn't eliminate this theory. If you can't find any other
explanation, you might try "rm -rf ~/.ccache" and see if that makes it
better.

(FWIW, PG9.2 builds fine on RHEL6.8 for me, and I'm sure it built fine
on 6.4, back when I was running that.)

regards, tom lane

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#3Nels Frazier
hellkite500@gmail.com
In reply to: Tom Lane (#2)
Re: BUG #14380: pg_config fails to build.

So I checked out ~/.ccache, and there was no such file/directory in my home
folder.

I tried configuring/building from both bash and tcsh, neither worked. This
is really strange, since I was able to build successfully on a RHEL 6.7
machine using:
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
GNU Make 3.8.1
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)

But on the RHEL 6.4 machine using:

GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
GNU Make 3.81
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)

the build fails. I even tried using a different compiler version (gcc
(GCC) 4.7.1) to no avail.

I did finally get a working build of pg_config with no errors or warning by
removing the single quotes in the path variables. I don't know if this is
correct or not, since I'm not familiar with the mechanics used by
make/pg_config. But changing
-DVAL_CONFIGURE="\"'--prefix=/glade/p/work/nfrazie1/CI-WATER-tools/'\""
to
-DVAL_CONFIGURE="\"--prefix=/glade/p/work/nfrazie1/CI-WATER-tools/\""

and -DVAL_LDFLAGS="\"-Wl,--as-needed
-Wl,-rpath,'/glade/p/work/nfrazie1/CI-WATER-tools/lib',--enable-new-dtags\""
to
-DVAL_LDFLAGS="\"-Wl,--as-needed
-Wl,-rpath,/glade/p/work/nfrazie1/CI-WATER-tools/lib,--enable-new-dtags\""

I was able to build pg_config. I hacked the Makefile to strip the quotes
out (see attached patch if interested.)

An interesting note: I checked to compile line for the build on the 6.7
machine, and it has the single quotes in the compile line.

Should it be ok to proceed using the patch to get a build completed?

Nels

On Tue, Oct 18, 2016 at 9:56 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Show quoted text

hellkite500@gmail.com writes:

I am attempting a build on a RHEL 6.4 machine using gcc 4.4.7.
I get the following error during the build.

[ scratches head... ] Weird. Evidently something is going wrong with
the quoting of those make variables; but the gcc command line looks
exactly as it should, AFAICT. Are you using a nonstandard shell, or
something other than the stock gcc installation?

A slightly far-fetched possibility is that you have a corrupted ccache
entry for this file. In a standard RHEL6 installation, "gcc" really
invokes "ccache gcc", so the lack of any mention of ccache in the given
command line doesn't eliminate this theory. If you can't find any other
explanation, you might try "rm -rf ~/.ccache" and see if that makes it
better.

(FWIW, PG9.2 builds fine on RHEL6.8 for me, and I'm sure it built fine
on 6.4, back when I was running that.)

regards, tom lane

Attachments:

postgresql-9.2.17.patchtext/x-patch; charset=US-ASCII; name=postgresql-9.2.17.patchDownload+2-2
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Nels Frazier (#3)
Re: BUG #14380: pg_config fails to build.

Nels Frazier <hellkite500@gmail.com> writes:

So I checked out ~/.ccache, and there was no such file/directory in my home
folder.

Hm, ccache RPM not installed then?

I tried configuring/building from both bash and tcsh, neither worked. This
is really strange, since I was able to build successfully on a RHEL 6.7
machine using:
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
GNU Make 3.8.1
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)

But on the RHEL 6.4 machine using:

GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
GNU Make 3.81
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)

the build fails. I even tried using a different compiler version (gcc
(GCC) 4.7.1) to no avail.

Don't know what to tell you. RHEL 6.4 was current during 2013, which is
the same year that 9.2 was our current release, and we would certainly
have noticed if there was any widespread (or even not so widespread)
build failure on that combination. Also, the code in question hasn't
changed in quite some time, so the issue would affect other PG branches
besides 9.2, making it even less likely that we'd have missed a problem.
I have to think that one or another component of your toolchain is
nonstandard or corrupted, but it's hard to say more than that.

Should it be ok to proceed using the patch to get a build completed?

Well, Postgres isn't going to care. Applications that make use of the
output of pg_config might be unhappy with the lack of quotes, although
most likely it wouldn't matter as long as there's not spaces or quotes
in your path names.

regards, tom lane

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs