I have still postgresql-server running in an active 8.1 slot, and wanted to migrate to 9.0.3-r3. I get compilation errors when linking initdb (since libpgport.a from the 8.1 slot is used) - ok - this can be resolved with temporaly linking /usr/lib/libpgport.a to the 9.0 slot. replication cannot be brought up, because libpqwalreceiver.so is linked to the libpq.so from the 8.1 slot. As my 8.1 slot is up and in production, there's no workaround for this. Reproducible: Always Steps to Reproduce: 1. emerge postgresql-server 2. 3. Actual Results: no successful emerge without changing the symlink of libpqport.a no successful replication because of wrong linked libraries (from the 8.1 slot) in libpqwalreceiver.so Expected Results: compile and run postgresql-server just as flawless when installed in just a single slot 9.0 Migration on the same machine not possible right now. Portage 2.1.9.42 (default/linux/x86/10.0/desktop, gcc-4.4.5, glibc-2.11.3-r0, 2.6.36-gentoo-r5 i686) ================================================================= System uname: Linux-2.6.36-gentoo-r5-i686-Intel-R-_Xeon-R-_CPU_5130_@_2.00GHz-with-gentoo-1.12.14 Timestamp of tree: Fri, 01 Apr 2011 07:45:01 +0000 ccache version 2.4 [enabled] app-shells/bash: 4.1_p9 dev-java/java-config: 2.1.11-r3 dev-lang/python: 2.6.6-r2, 3.1.3-r1 dev-util/ccache: 2.4-r9 dev-util/cmake: 2.8.1-r2 sys-apps/baselayout: 1.12.14-r1 sys-apps/sandbox: 2.4 sys-devel/autoconf: 2.13::<unknown repository>, 2.65-r1 sys-devel/automake: 1.7.9-r2, 1.9.6-r3, 1.10.3, 1.11.1 sys-devel/binutils: 2.20.1-r1 sys-devel/gcc: 4.3.4, 4.4.5 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.10 sys-devel/make: 3.81-r2 virtual/os-headers: 2.6.36.1 (sys-kernel/linux-headers) ACCEPT_KEYWORDS="x86" ACCEPT_LICENSE="* -@EULA" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /var/bind" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests binpkg-logs ccache distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en" MAKEOPTS="-j2 --load-average=1.3" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="X a52 aac acl acpi alsa apache2 berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif extras fam firefox flac fortran gd gdbm gdu gif gnutls gpm gtk gtk2 iconv jpeg lcms ldap libnotify mad mikmod mng modules mp3 mp4 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp pam pango pcre pdf perl php png policykit postgresi ppds pppd python qt3support qt4 readline sdl session spell sqlite ssl startup-notification svg sysfs tcpd tiff truetype udev unicode usb vorbis x264 x86 xcb xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="access auth auth_basic auth_dbm auth_anon auth_digest authz_groupfile alias file-cache echo charset-lite cache disk-cache mem-cache ext-filter case_filter case-filter-in deflate mime-magic cern-meta expires headers usertrack unique-id proxy proxy-connect proxy-ftp proxy-http info include cgi cgid dav dav-fs vhost-alias speling rewrite log_config logio env setenvif mime status autoindex asis negotiation dir imap actions userdir so filter authz_host vhost_alias authn_file authz_user" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS eselect postgresql list Available postgresql installations 8.1 <-* <-S base-8.1.23 docs-8.1.23 server-8.1.23 9.0 base-9.0.3-r1 docs-9.0.3-r1 server-9.0.3-r3
copied over libpqwalreceiver.so from the machine where only the 9.0 slot is installed, and (beside the libpgport.a temporary relink tweak while emerging) I get the DB up and replication running without any problems. So I think ebuild should be fixed to link initdb/libpqwalreceiver.so against the right libpgport.a/libpq.so (in case there are no other build errors after the initdb link error) Probably the -L opts have to be rearranged to use the slotted libraries in first place and the libs in /usr/lib only in case they are not supplied from the slot libraries. But I'm neither a Makefile nor a gcc/ld guru ;-) Gerhard
*** This bug has been marked as a duplicate of bug 352147 ***
(In reply to comment #2) > > *** This bug has been marked as a duplicate of bug 352147 *** In 352147 there are at least no compilation errors reported. I cannot even emerge 9.0 without errors, when another slot is active (both the stable 9.0.3 and the latest 9.0.3-r3). Maybe related to that I have an 8.1 slot active, which is not supported/upgraded anymore (released mid of Dec/2010). But how to migrate from that, when another slot is not compiling ? Gerhard
reopening this since I think this is NO duplicate. When emerging 9.0.3-r3 with an active 8.1 slot I get following error message: i686-pc-linux-gnu-gcc -O2 -march=prescott -pipe -fomit-frame-pointer -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -I../../../src/include initdb.o encnames.o pqsignal.o -L../../../src/port -Wl,-O1 -Wl,--as-needed -L/usr/lib -L/usr/lib/postgresql-9.0/lib -Wl,--as-needed -Wl,-rpath,'/usr/lib/postgresql-9.0/lib',--enable-new-dtags -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lz -lreadline -lcrypt -ldl -lm -o initdb initdb.o: In function `check_locale_encoding': initdb.c:(.text+0x42b): undefined reference to `pg_get_encoding_from_locale' initdb.o: In function `main': initdb.c:(.text+0x3c32): undefined reference to `pg_get_encoding_from_locale' initdb.c:(.text+0x5229): undefined reference to `strlcpy' collect2: ld returned 1 exit status make[3]: *** [initdb] Error 1 make[3]: Leaving directory `/var/tmp/portage/dev-db/postgresql-server-9.0.3-r3/work/postgresql-9.0.3/src/bin/initdb' calling the linker with the -L/usr/lib AFTER the -L/usr/lib/postgresql-9.0/lib linking of initdb is fine. When I temporary link /usr/lib/libpgport.a to the 9.0 slot (to avoid the above error message) and do a ldd /usr/lib/postgresql-9.0/lib/libpqwalreceiver.so I get: linux-gate.so.1 => (0xffffe000) libpq.so.4 => /usr/lib/postgresql-8.1/lib/libpq.so.4 (0xb7711000) libc.so.6 => /lib/libc.so.6 (0xb75d4000) libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0xb7585000) libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0xb742c000) libcrypt.so.1 => /lib/libcrypt.so.1 (0xb73f9000) /lib/ld-linux.so.2 (0xb7756000) libdl.so.2 => /lib/libdl.so.2 (0xb73f5000) libz.so.1 => /lib/libz.so.1 (0xb73e0000) So you see, libpqwalreceiver.so is linked against the 8.1 slot ! This prevents me from setting up this server a hot standby receiving streaming WALs. This is NOT related to setting up wrong symlinks in eselect-postgresql, but wrong order/wrong args of -L options to the linker.
List of things I'd like you to try: emerge -aC dev-db/postgresql-base:9.0 dev-db/postgresql-server:9.0 emerge -av dev-db/postgresql-base:9.0 dev-db/postgresql-server:9.0 If that still doesn't do the trick: emerge -av =app-admin/eselect-postgresql-1.0.6 eselect postgresql update emerge -av dev-db/postgresql-base:9.0 eselect postgresql set 9.0 emerge -av dev-db/postgresql-server:9.0
(In reply to comment #5) > List of things I'd like you to try: > emerge -aC dev-db/postgresql-base:9.0 dev-db/postgresql-server:9.0 > emerge -av dev-db/postgresql-base:9.0 dev-db/postgresql-server:9.0 > > > If that still doesn't do the trick: > emerge -av =app-admin/eselect-postgresql-1.0.6 > eselect postgresql update > emerge -av dev-db/postgresql-base:9.0 > eselect postgresql set 9.0 > emerge -av dev-db/postgresql-server:9.0 I don't see any reason why this could help. Did you see my error message when linking initdb while emerging postgresql-server-9.0.3-r3 ? As the linking is without any error, when I reverse -L/usr/lib and -L/usr/lib/postgresql-9.0/lib, this has nothing to do with the above. Also libpqwalreceiver.so linked to libpq.so of the wrong slot could probably be fixed by changing the Makefile.
I believe something screwy has happened on your system, so I'd like you to start over, as it were. You shouldn't have had to ln -s libpgport.a from anywhere as dev-db/postgresql-base provides that. I have multiple slots, and it all just works. At some point, 8.4 would have been my default slot before getting 9.0 installed, but everything is linked properly. So, please, just humor me, and give it a go. $ ldd /usr/lib/postgresql-9.0/lib/libpqwalreceiver.so linux-gate.so.1 => (0x51f9b000) libpq.so.5 => /usr/lib/postgresql-9.0/lib/libpq.so.5 (0x51f71000) libc.so.6 => /lib/libc.so.6 (0x51e13000) libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x51dbf000) libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x51c31000) libpthread.so.0 => /lib/libpthread.so.0 (0x51c17000) /lib/ld-linux.so.2 (0x51f9c000) libdl.so.2 => /lib/libdl.so.2 (0x51c13000) libz.so.1 => /lib/libz.so.1 (0x51bfd000) $ eselect postgresql list Available PostgreSQL Slots 8.2 server-8.2.20-r3 base-8.2.20-r2 docs-8.2.20-r1 8.3 server-8.3.14-r3 base-8.3.14-r2 docs-8.3.14-r1 8.4 server-8.4.7-r3 base-8.4.7-r2 docs-8.4.7-r1 9.0 * server-9.0.3-r4 base-9.0.3-r1 docs-9.0.3-r1 9.1 server-9.1_alpha5 base-9.1_alpha5 docs-9.1_alpha5 $ equery b /usr/lib/postgresql-9.0/lib/libpgport.a [ Searching for file(s) /usr/lib/postgresql-9.0/lib/libpgport.a in *... ] dev-db/postgresql-base-9.0.3-r1 (/usr/lib/postgresql-9.0/lib/libpgport.a)
You are right, the symlink to libpgport.a was from a time, berfore postgresql/my installation moved to slotted installation. I also had a /usr/lib/libpq.so.5 (no link) hanging around, which was also dated before my first slotted install. Removed the 2 files and emerging was fine :-) Thanks for pointing me to the right direction. Setting this to resolved.
(In reply to comment #8) > You are right, the symlink to libpgport.a was from a time, berfore > postgresql/my installation moved to slotted installation. I also had a > /usr/lib/libpq.so.5 (no link) hanging around, which was also dated before my > first slotted install. > Removed the 2 files and emerging was fine :-) > > Thanks for pointing me to the right direction. Setting this to resolved. This is really tricky. I just upgraded to eselect-postgresql-1.0.6 to be on the safe side, and it still generates links in /usr/lib which I had to explicitly delete to get postgresql-server-9.0.3-r3 successfully emerging. So how should this supposed to work, when in one place symlinks to the active slot are set and in the other place the existance of these symlinks breaks emerging another slot ? see below the links that eselect-postgresql did (on the machine where only 9.0 slot is present): lrwxrwxrwx 1 root root 39 Apr 5 14:31 /usr/lib/libpgport.a -> /usr/lib/postgresql-9.0/lib/libpgport.a lrwxrwxrwx 1 root root 40 Apr 5 14:31 /usr/lib/libpgtypes.a -> /usr/lib/postgresql-9.0/lib/libpgtypes.a lrwxrwxrwx 1 root root 41 Apr 5 14:31 /usr/lib/libpgtypes.so -> /usr/lib/postgresql-9.0/lib/libpgtypes.so lrwxrwxrwx 1 root root 43 Apr 5 14:31 /usr/lib/libpgtypes.so.3 -> /usr/lib/postgresql-9.0/lib/libpgtypes.so.3 lrwxrwxrwx 1 root root 45 Apr 5 14:31 /usr/lib/libpgtypes.so.3.1 -> /usr/lib/postgresql-9.0/lib/libpgtypes.so.3.1 lrwxrwxrwx 1 root root 35 Apr 5 14:31 /usr/lib/libpq.a -> /usr/lib/postgresql-9.0/lib/libpq.a lrwxrwxrwx 1 root root 36 Apr 5 14:31 /usr/lib/libpq.so -> /usr/lib/postgresql-9.0/lib/libpq.so lrwxrwxrwx 1 root root 38 Apr 5 14:31 /usr/lib/libpq.so.5 -> /usr/lib/postgresql-9.0/lib/libpq.so.5 lrwxrwxrwx 1 root root 40 Apr 5 14:31 /usr/lib/libpq.so.5.3 -> /usr/lib/postgresql-9.0/lib/libpq.so.5.3 lrwxrwxrwx 1 root root 47 Apr 5 14:31 /usr/lib/libpqwalreceiver.so -> /usr/lib/postgresql-9.0/lib/libpqwalreceiver.so
Those links don't matter in the way you think. Various applications depend on those links being there, and some don't even look anywhere else other than /usr/lib. As long as they're properly managed, you should be fine. Your environment should be normalized now and everything should work properly.
(In reply to comment #10) > Those links don't matter in the way you think. Various applications depend on > those links being there, and some don't even look anywhere else other than > /usr/lib. As long as they're properly managed, you should be fine. > > Your environment should be normalized now and everything should work properly. Nope. When I would run eselect postgresql update on my server, it would set up symlinks to my 8.1 slot and the whole dilemma would start all over when reemerging postgresql-server-9.0 for whatever reason (e.g. revdep-rebuild) With the links set up as eselect-postgresql does (in my case to the 8.1 slot) I would again get the error as described in comment # 4. Maybe you don't get any errors, because libpgport.a supplies pg_get_encoding_from_locale since 8.2, but it does not for 8.1 and so I get the compilation error. Slotted installation of postgresql-server should work without the need to switch posgresql-base to the corresponding slot, but this basically is the action I have to take to get the emerge go through (or tweaking the symlinks as previously posted)
Uhm, why is this marked as RESOLVED / FIXED ? I still do have build issues everytime I upgrade my 9.0 server slot :-( Manually removing the /usr/lib/libpgport.a and /usr/lib/libpg.so* before emerging does the job to get the build a) working at all and b) make libpqwalreceiver.so (and therefore a working streaming replication) linked to the correct slot. But everytime eselect-postgresql is updated, these files are generated again. Really annoying. Remember that I have the combination 8.1 - 9.0 ! Maybe the difference between later versions is not that big, so that there are no compliation errors due to unresolved symbols. Gerhard