Problem compiling FileZilla on Mac

Need help with FileZilla Client? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
pcman67
504 Command not implemented
Posts: 7
Joined: 2022-07-07 19:11
First name: Jason
Last name: Bourne

Problem compiling FileZilla on Mac

#1 Post by pcman67 » 2022-08-17 15:40

I am new to compiling source code, but I am attempting to learn so that I can eventually compile FileZilla as a native Apple Silicon application for the newer Macs.
That being said, I thought I'd try compiling FileZilla using the instructions located at https://wiki.filezilla-project.org/Comp ... nder_macOS.

I follow the steps exactly and everything is going nicely until I get to the final step in that Wiki -- the "Compile FileZilla" step. When I execute a "make", which is the very last command in specified in that Wiki, I get the following error and source code compiling stops:

libtool: compile: unable to infer tagged configuration
libtool: error: specify a tag with '--tag'
make[2]: *** [libfzclient_commonui_private_mac_la-fz_paths_osx.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

I am compiling the source code on an Intel-based 2015 MacBook Pro running MacOS 12.5 and was hoping that if I was successful in getting a "Intel x86_64" build, I could then explore trying to compile the source code to make a native Apple Silicon version of FileZilla, as another user has already done in another post.

Not sure if anyone is familiar with the tag error, but I have tried researching this the best I can and have so far not come up with a solution. Thanks in advance for any help that anyone can provide.

User avatar
botg
Site Admin
Posts: 35530
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Problem compiling FileZilla on Mac

#2 Post by botg » 2022-08-17 17:08

Please post more lines of the log. The error is useless without seeing the commands that lead to it.

pcman67
504 Command not implemented
Posts: 7
Joined: 2022-07-07 19:11
First name: Jason
Last name: Bourne

Re: Problem compiling FileZilla on Mac

#3 Post by pcman67 » 2022-08-17 18:39

Sure thing!

Here is the entire contents of the terminal window once the "make" command under "Compiling FileZilla" section in the Wiki is executed:

user@macbook filezilla-3.58.0 % make
Making all in .
make[1]: Nothing to be done for `all-am'.
Making all in src
Making all in include
make[2]: Nothing to be done for `all'.
Making all in engine
/Library/Developer/CommandLineTools/usr/bin/make all-am
make[3]: Nothing to be done for `all-am'.
Making all in pugixml
make[2]: Nothing to be done for `all'.
Making all in commonui
/bin/sh ../../libtool --mode=compile g++ -DHAVE_CONFIG_H -I../../config -I/Users/user/prefix/include -DBUILDING_FZ_COMMONUI -I/Users/user/prefix/include -fpch-preprocess -g -O2 -std=c++17 -MT libfzclient_commonui_private_mac_la-fz_paths_osx.lo -MD -MP -MF .deps/libfzclient_commonui_private_mac_la-fz_paths_osx.Tpo -c -o libfzclient_commonui_private_mac_la-fz_paths_osx.lo `test -f 'fz_paths_osx.mm' || echo './'`fz_paths_osx.mm
libtool: compile: unable to infer tagged configuration
libtool: error: specify a tag with '--tag'
make[2]: *** [libfzclient_commonui_private_mac_la-fz_paths_osx.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
user@macbook filezilla-3.58.0 %

User avatar
botg
Site Admin
Posts: 35530
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Problem compiling FileZilla on Mac

#4 Post by botg » 2022-08-17 20:06

Odd. What's the output the following command?

Code: Select all

libtool --version

pcman67
504 Command not implemented
Posts: 7
Joined: 2022-07-07 19:11
First name: Jason
Last name: Bourne

Re: Problem compiling FileZilla on Mac

#5 Post by pcman67 » 2022-08-17 20:51

I am running libtool version 2.4.7

User avatar
botg
Site Admin
Posts: 35530
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Problem compiling FileZilla on Mac

#6 Post by botg » 2022-08-17 22:48

That must be an unreleased development snapshot. Based on the official website at https://www.gnu.org/software/libtool/ the latest release is 2.4.6

Do you still experience this issue if you use the stable version of libtool and start over?

pcman67
504 Command not implemented
Posts: 7
Joined: 2022-07-07 19:11
First name: Jason
Last name: Bourne

Re: Problem compiling FileZilla on Mac

#7 Post by pcman67 » 2022-09-02 18:25

Yes, I still experience the same issue using libtool 2.4.6 and starting over from scratch. For now, I have given up trying to compile FileZilla on my Mac.
Do you know if there are any plans to have a universal binary of FileZilla for the Mac, or even a Apple Silicon native version of FileZilla?

seidnerj
504 Command not implemented
Posts: 6
Joined: 2023-01-01 21:24

Re: Problem compiling FileZilla on Mac

#8 Post by seidnerj » 2023-01-01 21:32

To resolve this issue, after running ./configure, go to ./src/commonui and edit "Makefile" like so:

1. Search for "libfzclient_commonui_private_mac_la_LINK", you should see a line similar to this:
libfzclient_commonui_private_mac_la_LINK = $(LIBTOOL) $(AM_V_lt) \

2. Replace the aforementioned line with an identical one while appending "--tag=CXX" like so:
libfzclient_commonui_private_mac_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \

3. Search for "bfzclient_commonui_private_mac_la-fz_paths_osx.lo: fz_paths_osx.mm", the next row should look similar to this (line end truncated):
$(AM_V_OBJCXX)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(OBJCXX) $(DEFS) ...

4. Replace the aforementioned line with an identical one while appending "--tag=CXX" after "$(LIBTOOLFLAGS)", like so:
$(AM_V_OBJCXX)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=CXX --mode=compile $(OBJCXX) $(DEFS) ...

After these changes, the compilation should succeed.

Unfortunately, even though I was able to successfully compile FileZila on my M1, when I try to run the filezilla executable, it is immediately killed. I compiled filezilla 3.62.2 with 2 different libfilezilla versions: 0.39.2 and 0.40.0, and both resulted in the same issue. All the other dependencies were installed using brew. There's probably some version incompatibility here that I am not aware of.

If anyone is successful compiling (and running!) this, I'd be interested to know how. Thanks in advance.

seidnerj
504 Command not implemented
Posts: 6
Joined: 2023-01-01 21:24

Re: Problem compiling FileZilla on Mac

#9 Post by seidnerj » 2023-01-01 23:18

Apparently the reason the executable is killed immediately is due to some code signing issue (am getting an EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid)) type exception), I tried signing and replacing: libidn.dylib, libfilezilla.dylib, and libwx_osx_cocoau_adv.dylib as suggested here: viewtopic.php?t=53544, then "make clean" and compiling again, but it doesn't seem to be enough. I am probably not signing all the dynamic libraries that are needed or there is some signature caching issue here that I cannot seem to be able to invalidate/refresh.

I am also wondering whether or not signing my just-compiled libfilezilla.dylib file (which resides under the "prefix", not in a system-wide directory) and only then building FileZilla is enough? am not sure where does FileZilla look for this library, i.e. is it included in the built executable or not.

I am attaching a text file with the complete instructions on how to compile/sign this on Mac OS X Ventura 13.1 (22C65). As I've said, it is still crashing due to an invalid code signature so I am probably missing some final small step(s) to get this done.

If anyone is able to take this all the way, It'd be great to know.

Thanks in advance.
Attachments
compile_filezilla_on_m1_instructions.txt
(4.2 KiB) Downloaded 247 times

seidnerj
504 Command not implemented
Posts: 6
Joined: 2023-01-01 21:24

Re: Problem compiling FileZilla on Mac

#10 Post by seidnerj » 2023-01-01 23:39

I was able to solve this, seems there's no need to sign the system's dynamic libraries, it is sufficient to sign all the dynamic libraries embedded in FileZilla.app's Frameworks directory, for example:

cd ~/Desktop/filezilla/src
cd filezilla-3.62.2
cd FileZilla.app/Contents/Frameworks
for file in *.*; do -s "your certificate" "$file"; done

I attached an up to date version of instructions to this post.

Hope this helps someone.

Cheers
about.jpg
about.jpg (184.78 KiB) Viewed 4471 times
Attachments
compile_filezilla_on_m1_instructions.txt
(2.9 KiB) Downloaded 262 times

seidnerj
504 Command not implemented
Posts: 6
Joined: 2023-01-01 21:24

Re: Problem compiling FileZilla on Mac

#11 Post by seidnerj » 2023-03-04 13:17

In my previous post, I forgot the "codesign" command in the signing, it should be as follows:

cd ~/Desktop/filezilla/src
cd filezilla-3.62.2
cd FileZilla.app/Contents/Frameworks
for file in *.*; do -s codesign "your certificate" "$file"; done

I am also re-attaching the complete (and fixed instructions).

Possibly a better way to solve the signing issue is to use (sent to me via PM by a member of this forum):
codesign --force --deep -s <Your Developer Certificate ID> FileZilla.app

I have not tested the above though.

Cheers
Attachments
compile_filezilla_on_m1_instructions-fixed.txt
(2.91 KiB) Downloaded 237 times

User avatar
botg
Site Admin
Posts: 35530
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Problem compiling FileZilla on Mac

#12 Post by botg » 2023-03-04 19:13

Always pass -o runtime to codesign.

seidnerj
504 Command not implemented
Posts: 6
Joined: 2023-01-01 21:24

Re: Problem compiling FileZilla on Mac

#13 Post by seidnerj » 2023-10-28 08:28

Attached updated instructions for v3.66.0.
Attachments
compile_filezilla_on_m1_instructions.txt
(3.43 KiB) Downloaded 315 times

Post Reply