Help needed to build Firebird 4.x on MacOS arm (m2)

866 views
Skip to first unread message

Grzegorz Żyła

unread,
Nov 16, 2023, 4:19:02 AM11/16/23
to firebird-devel
I read a thread on GH about compiling on macOS with ARM M1 and I'm trying to do it on M2.
I installed the brew packages and currently I'm stuck on linking.

ar: `u' modifier ignored since `D' is the default (see `U')

g++   -fvisibility-inlines-hidden -fvisibility=hidden -stdlib=libc++ -static-libstdc++ -L/opt/homebrew/opt/icu4c/lib -D_THREAD_SAFE     -Wl,-rpath,@loader_path/.. -Wl,-exported_symbols_list,empty.vers /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/c_cxx.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/cmd.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/cme.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/cmp.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/exp.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/gpre.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/hsh.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/int_cxx.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/jrdmet.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/movg.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/msc.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/obj_cxx.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/par.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/pat.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/sqe.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/sql.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/gpre/boot/gpre_meta_boot.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/yvalve/gds.o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/common.a -o /Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/gen/Release/firebird/bin/gpre_boot -L/Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/gen/Release/firebird/lib -liconv -lm  -framework CoreFoundation  -ldecFloat -lre2  -liconv -lobjc -framework Foundation -framework Security

clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]

ld: warning: ignoring duplicate libraries: '-liconv'

ld: multiple errors: archive member '/' not a mach-o file in '/Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/temp/Release/common.a'; archive member '/' not a mach-o file in '/Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/extern/decNumber/libdecFloat.a'; archive member '/' not a mach-o file in '/Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/extern/re2/obj/libre2.a'

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make[3]: *** [/Users/grzegorzzyla/Programming/Firebird-4.0.4.3010-0/gen/Release/firebird/bin/gpre_boot] Error 1

make[2]: *** [master_process] Error 2

make[1]: *** [firebird] Error 2

make: *** [firebird] Error 2


Adriano dos Santos Fernandes

unread,
Nov 16, 2023, 4:33:22 AM11/16/23
to firebir...@googlegroups.com
I recommend starting with v5 build and make it work.

Perhaps if you put all commands you are using and put the whole log in pastebin it may help.


Adriano


--
You received this message because you are subscribed to the Google Groups "firebird-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-deve...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebird-devel/2895a1a9-3678-4cf6-b442-8cc3d831613an%40googlegroups.com.

Grzegorz Żyła

unread,
Nov 16, 2023, 3:15:41 PM11/16/23
to firebird-devel
in sequence:
1. MacOS Ventura, M2 processor
2. Installed brew gcc13 - I used https://github.com/FirebirdSQL/firebird/issues/7041 as a guide
3. icu4c installed
4. export LDFLAGS="-L/opt/homebrew/opt/icu4c/lib"
export CPPFLAGS="-I/opt/homebrew/opt/icu4c/include"
export PATH="/opt/homebrew/opt/icu4c/include:$PATH"
export PATH="/opt/homebrew/opt/icu4c/lib:$PATH"
export PATH="/opt/homebrew/opt/binutils/bin:$PATH"
5. ./configure --with-builtin-tommath --with-builtin-tomcrypt
6. make

Adriano dos Santos Fernandes

unread,
Nov 16, 2023, 3:55:48 PM11/16/23
to firebir...@googlegroups.com


Em 16/11/23 17:15, Grzegorz Żyła escreveu:
> 2. Installed brew gcc13 - I used
> https://github.com/FirebirdSQL/firebird/issues/7041 as a guide

Why you installed gcc?

Mac build should use xcode/clang.


Adriano

Grzegorz Żyła

unread,
Nov 16, 2023, 4:22:13 PM11/16/23
to firebird-devel
because this is ARM and from the github thread I quoted, it appeared that compilations go with gcc from homebrew.

Adriano dos Santos Fernandes

unread,
Nov 16, 2023, 4:38:00 PM11/16/23
to firebir...@googlegroups.com
Em qui., 16 de nov. de 2023 18:22, Grzegorz Żyła <grzeg...@gmail.com> escreveu:
 from the github thread I quoted, it appeared that compilations go with gcc from homebrew.

I don't think it is. AFAIK gcc by default is alias to clang in mac.


Adriano

Grzegorz Żyła

unread,
Nov 16, 2023, 5:16:19 PM11/16/23
to firebird-devel
ok, so second try is... fb v5 from github.
and brew unlink gcc
now gcc i clang
./autogen
make
and..

-L/Users/grzegorzzyla/Programming/fbv5.0-release/gen/Release/firebird/lib -L/Users/grzegorzzyla/Programming/fbv5.0-release/temp/Release -lfbclient -ltommath -ltomcrypt -install_name @rpath/plugins/libEngine13.dylib

clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]

ld: warning: ignoring duplicate libraries: '-liconv', '-ltommath'

ld: archive member '/' not a mach-o file in '/Users/grzegorzzyla/Programming/fbv5.0-release/extern/re2/obj/libre2.a'

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make[3]: *** [/Users/grzegorzzyla/Programming/fbv5.0-release/gen/Release/firebird/plugins/libEngine13.dylib] Error 1

make[2]: *** [master_process] Error 2

make[1]: *** [firebird] Error 2

make: *** [firebird] Error 2

Grzegorz Żyła

unread,
Nov 16, 2023, 5:34:09 PM11/16/23
to firebird-devel
and other try for 4.0.4 from GitHub
without gcc 13, only clang

export CPPFLAGS=-I/opt/homebrew/opt/icu4c/include
export LDFLAGS=-L/opt/homebrew/opt/icu4c/lib
export LIBTOOL=glibtool
export LIBTOOLIZE=glibtoolize

export PATH="/opt/homebrew/opt/icu4c/lib:$PATH"

export PATH="/opt/homebrew/opt/icu4c/include:$PATH"

./autogen.sh
make

and...

/Library/Developer/CommandLineTools/usr/bin/make gpre

rm -f metadata.fdb

/Users/grzegorzzyla/Programming/fbv4.0-release/gen/Release/firebird/bin/isql -q -i /Users/grzegorzzyla/Programming/fbv4.0-release/src/dbs/metadata.sql

can't format message 17:0 -- message file /Users/grzegorzzyla/Programming/fbv4.0-release/gen/Release/firebird/firebird.msg not found

Could not find acceptable ICU library

can't format message 17:120 -- message file /Users/grzegorzzyla/Programming/fbv4.0-release/gen/Release/firebird/firebird.msg not found

make[3]: *** [metadata.fdb] Error 1

make[2]: *** [master_process] Error 2

make[1]: *** [firebird] Error 2

make: *** [firebird] Error 2

hm...

Adriano dos Santos Fernandes

unread,
Nov 16, 2023, 7:24:30 PM11/16/23
to firebir...@googlegroups.com
On 16/11/2023 19:16, Grzegorz Żyła wrote:
> and brew unlink gcc

Are you sure it also uninstalled binutils?


Adriano

Grzegorz Żyła

unread,
Nov 16, 2023, 7:30:38 PM11/16/23
to firebird-devel

no, binutils has not been removed. I will remove it and let you know.

Grzegorz Żyła

unread,
Nov 17, 2023, 4:01:02 AM11/17/23
to firebird-devel
v6 built without errors, tests without errors, pkg done.
v5 same :)
now time for 4.0.4
Message has been deleted

Grzegorz Żyła

unread,
Nov 17, 2023, 4:08:47 AM11/17/23
to firebird-devel
v4 same problem with icu lib

exports:

CPPFLAGS=-I/opt/homebrew/opt/icu4c/include

LDFLAGS=-L/opt/homebrew/opt/icu4c/lib

LIBTOOL=glibtool

LIBTOOLIZE=glibtoolize

PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin

./autogen.sh --with-builtin-tommath --with-builtin-tomcrypt


build result (make):

/common.a -L/Users/grzegorzzyla/Programming/fbv4.0-release/gen/Release/firebird/lib  -liconv -lm  -framework CoreFoundation  -ldecFloat -lre2  -liconv -lobjc -framework Foundation -framework Security -ltommath -ltomcrypt -L/Users/grzegorzzyla/Programming/fbv4.0-release/gen/Release/firebird/lib -lfbclient -ltommath -ltomcrypt -install_name @rpath/plugins/libEngine13.dylib

ld: warning: ignoring duplicate libraries: '-liconv', '-ltomcrypt', '-ltommath'

/Library/Developer/CommandLineTools/usr/bin/make fbintl

make[3]: Nothing to be done for `fbintl'.

/Library/Developer/CommandLineTools/usr/bin/make utilities

/Library/Developer/CommandLineTools/usr/bin/make ibutil

make[4]: Nothing to be done for `ibutil'.

/Library/Developer/CommandLineTools/usr/bin/make gpre

rm -f metadata.fdb

/Users/grzegorzzyla/Programming/fbv4.0-release/gen/Release/firebird/bin/isql -q -i /Users/grzegorzzyla/Programming/fbv4.0-release/src/dbs/metadata.sql

can't format message 17:0 -- message file /Users/grzegorzzyla/Programming/fbv4.0-release/gen/Release/firebird/firebird.msg not found

Could not find acceptable ICU library

can't format message 17:120 -- message file /Users/grzegorzzyla/Programming/fbv4.0-release/gen/Release/firebird/firebird.msg not found

make[3]: *** [metadata.fdb] Error 1

make[2]: *** [master_process] Error 2

make[1]: *** [firebird] Error 2

make: *** [firebird] Error 2

Grzegorz Żyła

unread,
Nov 17, 2023, 4:37:41 AM11/17/23
to firebird-devel
but, when i use prepare and compile from this package https://github.com/FirebirdSQL/firebird/files/7644557/fb_3.0.8_darwin_aarch64.zip
build is ok, but i have the same problem as here https://github.com/FirebirdSQL/firebird/issues/7041#issuecomment-993009011
how to build pkg?

Grzegorz Żyła

unread,
Nov 17, 2023, 4:50:41 AM11/17/23
to firebird-devel
Uff!! Sucessfull :)
Thank you for your patience
 solution is zip from @e787 and uncommenting a few lines in compile.sh

Grzegorz Żyła

unread,
Nov 17, 2023, 5:13:22 AM11/17/23
to firebird-devel
the last question is... where does the installer install Firebird by default on macOS?

Adriano dos Santos Fernandes

unread,
Nov 17, 2023, 5:53:38 AM11/17/23
to firebir...@googlegroups.com
On 17/11/2023 07:13, Grzegorz Żyła wrote:
> the last question is... where does the installer install Firebird by
> default on macOS?

.github/workflows/main.yml is a place you can look:

/Library/Frameworks/Firebird.framework


Adriano

Reply all
Reply to author
Forward
0 new messages