Opened 11 years ago

Last modified 10 years ago

#42128 new submission

[NEW] Firebird 2.5 Portfile, still problem compiling

Reported by: jul_bsd@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: mojca (Mojca Miklavec)
Port: Firebird

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Hello,

A new submit of an updated Portfile for current Firebird SQL Database. (previous ticket #2788)

It seems macports introduces comlexities as manually, it builds like

$ CC=/opt/local/bin/gcc-mp-4.9 CXX=/opt/local/bin/g++-mp-4.9 ./configure && make
[...]
$ cd gen && make -f Makefile.fbtrace
$ cd .. && make
 [...]

CFLAGS/LDFLAGS/CXXFLAGS seems partially respected as some errors can be solved by adding "-L/opt/local/lib
Discussion has been made w macos binary package but couldn't solve all the problems for now.

Install locations need to be reviewed as Firebird as a Framework tree in /Library/Framework (at least in current binary packages)

Test on os 10.9.1 w latest macports

Attachments (13)

Portfile.2 (3.0 KB) - added by jul_bsd@… 11 years ago.
Firebird-main.log (484.2 KB) - added by jul_bsd@… 11 years ago.
main.log: building fails in macports
firebird-build-w-included-icu.log (484.6 KB) - added by jul_bsd@… 11 years ago.
firebird-build-w-system-icu.log (731.5 KB) - added by jul_bsd@… 11 years ago.
firebird-build-w-system-icu-B1.log (708.4 KB) - added by jul_bsd@… 11 years ago.
firebird-build-w-system-icu-B2.log (179.4 KB) - added by jul_bsd@… 11 years ago.
firebird-build-w-included-icu-C.log (485.4 KB) - added by jul_bsd@… 11 years ago.
firebird-build-w-system-icu-F1.log (356.8 KB) - added by jul_bsd@… 11 years ago.
firebird-build-w-system-icu-F2.log (114.8 KB) - added by jul_bsd@… 11 years ago.
firebird-build-w-system-icu-F3.log (572.0 KB) - added by jul_bsd@… 11 years ago.
firebird-build-w-included-icu-F1.log (397.8 KB) - added by jul_bsd@… 11 years ago.
firebird-build-manual.log (1.2 MB) - added by jul_bsd@… 11 years ago.
Portfile (5.3 KB) - added by jul_bsd@… 10 years ago.

Change History (26)

comment:1 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Port: Firebird added

Thanks. Some observations:

  • "openmaintainer" by itself is not a valid value for maintainers; either add your obfuscated email address to that to make yourself the maintainer, or change it to "nomaintainer"
  • compiler.blacklist isn't used if you set configure.compiler explicitly.
  • Don't hardcode /Library/Frameworks; use ${frameworks_dir} instead.

comment:2 Changed 11 years ago by jul_bsd@…

Here an update w requested modifications. Any hints about the complications macports could introduce and make the source not compiling ? Thanks

Changed 11 years ago by jul_bsd@…

Attachment: Portfile.2 added

Changed 11 years ago by jul_bsd@…

Attachment: Firebird-main.log added

main.log: building fails in macports

comment:3 Changed 11 years ago by neverpanic (Clemens Lang)

The problem occurs while firebird is trying to build a local copy of icu (at version 30.x, current is 52.1, MacPorts has 51.2) but fails, because the linker line

:info:build /opt/local/bin/g++-mp-4.9 -dynamiclib -dynamic -pipe -Os -m64 -D_THREAD_SAFE -O2 -arch x86_64 -mmacosx-version-min=10.6 -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-compatibility_version -Wl,30 -Wl,-current_version -Wl,30.0 -install_name /Library/Frameworks/Firebird.framework/Versions/A/Libraries/libicuuc.dylib -o ../lib/libicuuc.dylib.30.0 putil.o uobject.o cmemory.o umutex.o udata.o ucmndata.o udatamem.o udataswp.o umapfile.o ucol_swp.o uresbund.o ur esdata.o resbund.o ucat.o locmap.o uloc.o locid.o uhash.o uhash_us.o ucnv.o ucnv_bld.o ucnv_cb.o ucnv_cnv.o ucnv_err.o ucnv_ext.o ucnv_io.o ucnvlat1.o ucnv_u7.o ucnv_u8.o ucnv_u16.o ucnv_u32.o ucnvscsu.o ucnvbocu.o ucnvmbcs.o ucnv2022.o ucnv hz.o ucnv_lmb.o ucnvisci.o unistr.o utf_impl.o ustring.o ustrcase.o cstring.o ustrfmt.o ustrtrns.o normlzr.o unorm.o unorm_it.o chariter.o schriter.o uchriter.o uiter.o uchar.o uprops.o propname.o ubidi.o ubidiwrt.o ubidiln.o ushape.o unames .o ucln_cmn.o uscript.o usc_impl.o uvector.o ustack.o uvectr32.o ucmp8.o uarrsort.o utrie.o uset.o uniset.o ruleiter.o caniter.o unifilt.o unifunct.o usetiter.o brkiter.o brkdict.o ubrk.o dbbi.o dbbi_tbl.o rbbi.o rbbidata.o rbbinode.o rbbirb .o rbbiscan.o rbbisetb.o rbbistbl.o rbbitblb.o icuserv.o iculserv.o icunotif.o uenum.o ustrenum.o uidna.o usprep.o punycode.o cwchar.o filestrm.o umemstrm.o util.o parsepos.o utrace.o locbased.o -L../lib -L../stubdata -licudata -lpthread -lm

tries to link against its internal copy of libicudata.dylib using -licudata in ../lib, but finds the one installed by MacPorts due to -L/opt/local/lib before -L../lib first, links against that one, which doesn't have _icudt30_dat but _icudt51_dat, which causes the link to fail:

:info:build Undefined symbols for architecture x86_64:
:info:build   "_icudt30_dat", referenced from:
:info:build       _openCommonData.part.0 in udata.o
:info:build ld: symbol(s) not found for architecture x86_64
:info:build collect2: error: ld returned 1 exit status

So,

  • Can Firebird be convinced to not build a private copy of icu, but rather just use the one MacPorts already has?
  • If not, you need to adjust LDFLAGS or the linker search path in a way that will cause the linker to find the libicudata.dylib in ../lib first.

I also think using GCC for C++ code is critical since 10.9, because all other C++ libs use the new libc++ runtime library, but stuff built with GCC will use libstdc++. Since you can't mix those two libraries you'll not be able to use any libraries installed by this port in other ports using C++ (and I'd assume that would affect the firebird client libraries). Please file a ticket upstream to request clang and libc++ compatibility.

comment:4 Changed 11 years ago by jul_bsd@…

Thanks for the feedback cal@

For icu, I had a discussion w the maintainer of firebird binary package for mac and he sayd

2. Ideally you shouldn't use the --with-system-icu it causes all sorts of problems. If you create a database
using one version of ICU (say the latest version in macports) using UTF8 for example, if you then
try and use that database on a default build of Firebird 2.5 downloadable from Sourceforge, it
won't work, you will need to back up and restore the database to make it usable. Normally (in the past)
except for endian issues, databases can be swopped between intel systems without any problems.

I had a try both w or w/o system-icu but no success. I changed the portfile to get the two as variants but default is the one included as recommended on firebird side. but w LDFLAGS="-L../lib", it's correctly added to command but same error Currently

  • included icu: error like above
  • system icu:
    /opt/local/bin/ranlib: archive member: ../gen/firebird/lib/libfbstatic.a(tpc.o) size too large (archive member extends past      the end of the file)
    

I don't understand the point about gcc. I forced the latest one gcc-4.9 (as clang got "error: thread-local storage is unsupported for the current target"), so it should be libc++, no ? On clang compatibility, seems improving https://twitter.com/firebirdsql/status/404765948663451648 but not sure if released or maybe just part of 3.0 (alpha)

I update the Portfile and join main.log in both cases.

Changed 11 years ago by jul_bsd@…

Changed 11 years ago by jul_bsd@…

comment:5 in reply to:  4 Changed 11 years ago by larryv (Lawrence Velázquez)

Replying to jul_bsd@…:

I don't understand the point about gcc. I forced the latest one gcc-4.9 (as clang got "error: thread-local storage is unsupported for the current target"), so it should be libc++, no ?

No. GCC uses its own libstdc++ library.

comment:6 Changed 11 years ago by neverpanic (Clemens Lang)

The ranlib problem might go away if you just try again after it failed for the first time. Of course, that's not a permanent solution, but it would provide another datapoint that might help in debugging.

I think the icu linker command might fail even due to the correct -L argument because OS X' linker will always try to find dynamic libraries (.dylibs) in all paths first before attempting to link against static libraries and the firebird build probably builds libicudata.a in extern/icu/source/lib. Try adding -search_paths_first to the LDFLAGS (although according to the manpage this behaviour changed with Xcode >= 4, which you probably have).

Which files matching libicudata.* are there in extern/icu/source/lib? What does nm $file | grep icudt print on them?

comment:7 Changed 11 years ago by jul_bsd@…

  • systemicu, it builds almost all at second call and fails on something stupid. joined B1,B2 logs
:info:build cp ../../examples/include/*.* ../../gen/firebird/examples/include/
:info:build cp ../../examples/stat/*.* ../../gen/firebird/examples/stat/
:info:build cp ../../examples/udf/*.* ../../gen/firebird/examples/udf/
:info:build cp employee.fdb ../../gen/firebird/examples/empbuild/
:info:build cp: employee.fdb: No such file or directory
:info:build gmake[2]: *** [../../gen/firebird/examples/README] Error 1
:info:build gmake[2]: Leaving directory `/opt/local/var/macports/build/_Volumes_Data_myports_database_firebirdsql/Firebird/work/Firebird-2.5.2.26540-0/gen/examples'
:info:build gmake[1]: *** [examples_cp] Error 2
:info:build gmake[1]: *** Waiting for unfinished jobs....
  • includedicu

the search_path_first fails in configure. clang only?

configure:3193: checking for C compiler default output file name
configure:3215: /opt/local/bin/gcc-mp-4.9 -pipe -Os -m64 -I/opt/local/include -L/opt/local/var/macports/build/_Volumes_Data_myports_database_firebirdsql/Firebird/work/Firebird-2.5.2.26540-0/extern/icu/source/lib -search_paths_first -L/opt/local/lib -Wl,-headerpad_max_install_names conftest.c  -framework CoreFoundation >&5
gcc-mp-4.9: error: unrecognized command line option '-search_paths_first'
configure:3219: $? = 1 

after a build without it, I have an empty extern/icu/source/lib, files are in extern/icu/source/stubdata/

$ nm /opt/local/var/macports/build/_Volumes_Data_myports_database_firebirdsql/Firebird/work/Firebird-2.5.2.26540-0/extern/icu/source/stubdata/* |grep icudt
0000000000000fc0 S _icudt30_dat
0000000000000fc0 S _icudt30_dat
0000000000000fc0 S _icudt30_dat
0000000000000000 S _icudt30_dat

so I switched locations but it's really just stub and missing tons of other symbols

In my manual compile folder, I have all:

$ find . -iname '*libicudata*' -ls
8473735        8 lrwxr-xr-x    1 user           admin                  21  2 mar 08:07 ./extern/icu/source/lib/libicudata.dylib -> libicudata.dylib.30.0
8473734        8 lrwxr-xr-x    1 user           admin                  21  2 mar 08:07 ./extern/icu/source/lib/libicudata.dylib.30 -> libicudata.dylib.30.0
8473733     3048 -rwxr-xr-x    1 user           admin             1556576  2 mar 08:07 ./extern/icu/source/lib/libicudata.dylib.30.0
8471844        8 lrwxr-xr-x    1 user           admin                  21  2 mar 08:04 ./extern/icu/source/stubdata/libicudata.dylib -> libicudata.dylib.30.0
8471843        8 lrwxr-xr-x    1 user           admin                  21  2 mar 08:04 ./extern/icu/source/stubdata/libicudata.dylib.30 -> libicudata.dylib.30.0
8471842       16 -rwxr-xr-x    1 user           admin                4192  2 mar 08:04 ./extern/icu/source/stubdata/libicudata.dylib.30.0
8479526     3048 -rwxr-xr-x    1 user           admin             1556576  2 mar 08:42 ./gen/firebird/frameworks/FirebirdCS.framework/Versions/A/Libraries/libicudata.dylib
8478689        8 lrwxr-xr-x    1 user           admin                  21  2 mar 08:07 ./gen/firebird/lib/libicudata.dylib -> libicudata.dylib.30.0
8478690        8 lrwxr-xr-x    1 user           admin                  21  2 mar 08:07 ./gen/firebird/lib/libicudata.dylib.30 -> libicudata.dylib.30.0
8478691     3048 -rwxr-xr-x    1 user           admin             1556576  2 mar 08:07 ./gen/firebird/lib/libicudata.dylib.30.0
$ nm extern/icu/source/lib/libicudata.dylib.30.0 |grep icudt
0000000000000600 S _icudt30_dat

Changed 11 years ago by jul_bsd@…

Changed 11 years ago by jul_bsd@…

comment:8 in reply to:  7 Changed 11 years ago by neverpanic (Clemens Lang)

Replying to jul_bsd@…:

  • systemicu, it builds almost all at second call and fails on something stupid. joined B1,B2 logs
:info:build cp ../../examples/include/*.* ../../gen/firebird/examples/include/
:info:build cp ../../examples/stat/*.* ../../gen/firebird/examples/stat/
:info:build cp ../../examples/udf/*.* ../../gen/firebird/examples/udf/
:info:build cp employee.fdb ../../gen/firebird/examples/empbuild/
:info:build cp: employee.fdb: No such file or directory
:info:build gmake[2]: *** [../../gen/firebird/examples/README] Error 1
:info:build gmake[2]: Leaving directory `/opt/local/var/macports/build/_Volumes_Data_myports_database_firebirdsql/Firebird/work/Firebird-2.5.2.26540-0/gen/examples'
:info:build gmake[1]: *** [examples_cp] Error 2
:info:build gmake[1]: *** Waiting for unfinished jobs....

Can't offer any insight on that, sorry. Seems you'll have to dive into the Makefiles and fine out where the missing file should come from.

  • includedicu

the search_path_first fails in configure. clang only?

configure:3193: checking for C compiler default output file name
configure:3215: /opt/local/bin/gcc-mp-4.9 -pipe -Os -m64 -I/opt/local/include -L/opt/local/var/macports/build/_Volumes_Data_myports_database_firebirdsql/Firebird/work/Firebird-2.5.2.26540-0/extern/icu/source/lib -search_paths_first -L/opt/local/lib -Wl,-headerpad_max_install_names conftest.c  -framework CoreFoundation >&5
gcc-mp-4.9: error: unrecognized command line option '-search_paths_first'
configure:3219: $? = 1 

It's a linker flag, try with -Wl,-search_paths_first if you're passing it to the compiler.

after a build without it, I have an empty extern/icu/source/lib, files are in extern/icu/source/stubdata/

Why is extern/icu/source/lib empty when building with included ICU? That sounds wrong to me, but then again, I can only guess at this point short of diving into the Makefiles myself, and I currently have no time to do so. Maybe starting over (port clean firebird) would help?

comment:9 Changed 11 years ago by jul_bsd@…

I tried w "-Wl,-search_paths_first", it configured and built but didn't solve the problem. joined log (C, included icu) I will see if I have time to dig Makefile. I also asked help to the mac binary maintainer on firebird side.

Changed 11 years ago by jul_bsd@…

comment:10 Changed 11 years ago by jul_bsd@…

another round

  • w system icu

various compiling error different than employee.fdb previous error (from digging, called from Makefile.examples and examples/build_unix/Makefile.in*). see corresponding F log ...

  • w included icu

same problem w stub I joined also a log of manual built (like said in first post) and it's interesting to see that on 32nd difference (after "generating dependency information for putil.c"), we see the manual one building the included icu but not in macports. don't know why for now :(

  • about clang, add a variant w clang support. just prefer the rest to compile/destroot well before merging all

Changed 11 years ago by jul_bsd@…

Changed 11 years ago by jul_bsd@…

Changed 11 years ago by jul_bsd@…

Changed 11 years ago by jul_bsd@…

Changed 11 years ago by jul_bsd@…

Attachment: firebird-build-manual.log added

comment:11 Changed 11 years ago by jul_bsd@…

  • port lint --nitpick
  • livecheck
  • /tab/spacex4/

comment:12 Changed 10 years ago by jul_bsd@…

  • use compiler.blacklist instead of configure.compiler, still in review
  • still not compiling

Changed 10 years ago by jul_bsd@…

Attachment: Portfile added

comment:13 Changed 10 years ago by mojca (Mojca Miklavec)

Cc: mojca@… added

Cc Me!

Note: See TracTickets for help on using tickets.