Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 10800 - Postgresql cannot build
Summary: Postgresql cannot build
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: High critical
Assignee: Preston A. Elder (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-15 18:09 UTC by Axxackall
Modified: 2007-09-22 23:10 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Axxackall 2002-11-15 18:09:39 UTC
I am trying to build postgresql-7.2.3-r1 on gentoo-1.4-rc1 PPC, but backend
comiplation gives me the following:

...
access/SUBSYS.o: In function `XLogFlush':
access/SUBSYS.o(.text+0x23cb8): undefined reference to `tas'
access/SUBSYS.o(.text+0x23cb8): relocation truncated to fit: R_PPC_REL24 tas
access/SUBSYS.o(.text+0x25964): more undefined references to `tas' follow
access/SUBSYS.o: In function `CreateCheckPoint':
access/SUBSYS.o(.text+0x25964): relocation truncated to fit: R_PPC_REL24 tas
...
storage/SUBSYS.o: In function `s_lock':
storage/SUBSYS.o(.text+0xe9f0): relocation truncated to fit: R_PPC_REL24 tas
collect2: ld returned 1 exit status
make[2]: *** [postgres] Error 1
make[2]: Leaving directory
`/var/tmp/portage/postgresql-7.2.3-r1/work/postgresql-7.2.3/src/backend'
...

Same postgresql release is build (ebuild) fine on Gentoo-1.4-rc1-x86.
Same version of postgresql from vanilla sources is compiled fine on the same
Gentoo-1.4-rc1-PPC.

I thought the problem in ppc patches in postgresql ebuild, but they seem also fine.

So, what else did I miss?
Comment 1 Axxackall 2002-11-16 13:54:00 UTC
Later I've tried other 7.x ebuild - sma eresult.
I've tried to comment out the call to patch in ebuild files - same results.

But the most strange thing is that I've tried to build from vanilla sources of
the same source code tarballs OUTSIDE of portage (tar zxvf $; cd $; ./configure
; make ) with the SAME --with config flags - the result was positive and
postgresql has been build sucessfully.

So, the problem is not in pathes. And I doubt the probelm is in the operating
system in general. It's more likely that the problem is in somewhere in portage
system. Unless I still miss something.
Comment 2 Ryan Phillips (RETIRED) gentoo-dev 2002-11-19 23:21:14 UTC
Hope you don't mind me transfering this to you trance...
Comment 3 Axxackall 2002-11-23 16:51:25 UTC
If it makes any sense: that was on Powerbook Pismo with G3 and -O3.

After I've just installed Gentoo on grey-G4 with -O2 it helped to compile.

But now it cannot initialize: 

"vacuuming database template1... /usr/bin/initdb: line 647: 7666 Segmentation fault"

Does it help?
Comment 4 Mark Guertin 2002-11-25 17:09:03 UTC
not sure how active trance is, I took over the bug, as of yet I have been unable
to make _any_ version of postgresql work on ppc w/ gcc 3.2

Will look into this further
Comment 5 Mark Guertin 2002-11-26 11:57:18 UTC
ok, need some help

I've built the latest one successfully with these cflags:

-pipe -fsigned-char

it seems that it doesnt like any -O optimization (is same for 2 other distros).

I got past initdb, etc, but know next to nothing about postgresl, it complains
about shared memory allocations and the like.

Can you try to emerge it like this:

USE="-*" CFLAGS="-pipe -fsigned-char" emerge
/usr/portage/dev-db/postgresql/postgresql-7.2.3-r1.ebuild

let me know if it's working ok, if it is I will commi to filter the -Ox flags
and we can go from there.
Comment 6 David Chamberlain (RETIRED) gentoo-dev 2002-11-26 13:08:53 UTC
I've been using postgresql 7.2.3-r1 on ppc (iMac G3), with the 1.4 rc, for a
week or two now.  I used the standard G3 optimisations from make.conf with no
problems in compiling.  There _is_ an issue with the init script: the line that
calls postmaster does ask it to use too much shared memory (at least for this
setup)- i.e. to accept too many connections (1024, which is the default - go
figure).  There may be a better fix, but a quick fix is to change that line to
end with "-N 768 -B 2048".  There also seem to be random  issues with the config
stage of the ebuild not getting the permissions right for setting up the data
directory.  Brute force (re-running the ebuild config until it got it right)
worked for me.
I've just installed gentoo 1.4 on my tiBook, and postgres failed to compile on
first attempt.  I'll follow up if I can get it to work.
Comment 7 Mark Guertin 2002-11-26 13:32:33 UTC
hey daybird, thought you had dissappeared into the void there...

try the CFLAGS from above if you would, seems to work for me,and stop by irc and
say Hi! ;)
Comment 8 Axxackall 2002-11-26 13:49:16 UTC
I confirm: 

<code>USE="-*" CFLAGS="-pipe -fsigned-char"</code> helps to compile and run
without segfaults. 

<code>"-N 768 -B 2048"</code> helps to run after I added one more fix: the user
postgres in /etc/passwd should have /bin/bash rather than /bin/false. Otherwise
it doesn't start.

I'll run more crashing regression tests later and report a problem if I'll meet
such.

Should new flags and rc.script (and et/c/passwd?) patch be included to the portage?

P.S. Why -N 768? For personal development AND web-server's db-connection pool
even -N 32 is enough. The real value anyway should be set by db admin after lots
of perfomance and configuration tests, which are not related to portage.
Comment 9 Axxackall 2002-11-26 15:13:19 UTC
Correction:
====

USE="-*" CFLAGS="-pipe -fsigned-char" helps to compile it without error
(experienced on the PPC box with -O3 system-wide) and run it without segfaults
(experienced on the PPC box with -O2 system-wide).

"-N 768 -B 2048" helps to start it, although after I added one more fix: the
user postgres in /etc/passwd should have /bin/bash rather than /bin/false.
Otherwise it doesn't start. Besides, postgres user helps to create real users in
the DB. (Should ebuild config also set up some default passwd for that user?
Alternatively, should ebuild config also add root to the db user list?)

I'll run more crashing regression tests later and report a problem if I'll meet
such.

Should new cflags and ebuild config changes be included to the portage?

P.S. Why -N 768? For personal development AND web-server's db-connection pool
even -N 32 is enough. The real value anyway should be set by db admin after lots
of perfomance and configuration tests, which are not related to portage.
Besides, the style of Gentoo is minimalistic: no unnecessary resource
consumption, isn't it?
Comment 10 Mark Guertin 2002-11-26 15:55:01 UTC
I have set these CFLAGS for ppc on latest build only, set all others as -ppc. 
Will pass this back to rphillips for other issues (I am truly a postgresql
ludite and can't properly finish the non ppc specific parts)
Comment 11 Mark Guertin 2002-12-05 09:34:19 UTC
rphillips: any comments etc on this situation?
Comment 12 Mark Guertin 2002-12-13 10:14:55 UTC
Tossing this back to bug wranglers, it needs attention as this build is 
_always_ problematic and it's been come time now 
Comment 13 Ryan Phillips (RETIRED) gentoo-dev 2002-12-14 17:18:29 UTC
I can't test this on PPC... I haven't had any trouble with the ebuild on x86.
Comment 14 Mark Guertin 2002-12-16 09:35:39 UTC
I was looking for comments on this post:

http://bugs.gentoo.org/show_bug.cgi?id=10800#c9

The ppc portions are taken care of already.
Comment 15 Preston A. Elder (RETIRED) gentoo-dev 2002-12-16 09:49:14 UTC
Can anyone else verify this?  If so, this bug can be closed, as it appears to only be a PPC problem, and if that is now fixed, this bug is also resolved. 
Comment 16 Mark Guertin 2002-12-18 09:46:57 UTC
was looking for thoughts/answers on this quote from earlier:

P.S. Why -N 768? For personal development AND web-server's db-connection pool
even -N 32 is enough. The real value anyway should be set by db admin after lots
of perfomance and configuration tests, which are not related to portage.
Comment 17 Mark Guertin 2003-01-03 09:29:34 UTC
well I guess I will close this bug due to lack of interest for the postgres sql
devs.  rather disheartening to say the least.