rdp / ffmpeg-windows-build-helpers

Helper script for cross compiling some media tools for windows, like customizable ffmpeg.exe (with or without non-free components, etc), and some other bonuses like mplayer, mp4box, mxf, etc.
GNU General Public License v3.0
1.09k stars 414 forks source link

Error building native on OSX 13.1 Ventura **solved** #667

Open JokerGT opened 1 year ago

JokerGT commented 1 year ago

even after installing all dependencies with brew install ragel wget cvs yasm autogen automake autoconf cmake libtool xz pkg-config nasm bzip2 autoconf-archive p7zip coreutils meson llvm texinfo python

Could not find the following execs (svn is actually package subversion, makeinfo is actually package texinfo if you're missing them): python

when i search for python i found python@3.11 installed and python-build also

when i comment the check out, the script runs... but not far

Making /Users/joker/Code/ffmpeg-windows-build-helpers/sandbox/zlib-1.2.11 as $ PATH=/Users/joker/Code/ffmpeg-windows-build-helpers/sandbox/cross_compilers/native/bin:$PATH make PREFIX=/Users/joker/Code/ffmpeg-windows-build-helpers/sandbox/cross_compilers/native ARFLAGS=rcs -j 16

libtool rcs libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o 
error: /Library/Developer/CommandLineTools/usr/bin/libtool: no output file specified (specify with -o output)
Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
make: *** [libz.a] Error 1

no output file specified ?

JokerGT commented 1 year ago

after removing the check for python (which is installed) i just removed ARFLAGS=rcs within build_zlib() function which let the script continue compiling until i run into

Libunistring was not found failed configure gnutls-3.6.15

i also had to remove libflite: error: implicit declaration of function 'indic_digit_to_offset' is invalid in C99 i don't know if it would work to change the standard to 14/17/20 ?

JokerGT commented 1 year ago

i had to disable a few more modules to end up here:

LD  ffprobe_g
Undefined symbols for architecture x86_64:
  "_SecCopyErrorMessageString", referenced from:
Undefined symbols for architecture x86_64:
  "_SecCopyErrorMessageString", referenced from:
Undefined symbols for architecture x86_64:
  "_SecCopyErrorMessageString", referenced from:
      _gnutls_x509_trust_list_add_system_trust in libgnutls.a(certs.o)
      _gnutls_x509_trust_list_add_system_trust in libgnutls.a(certs.o)
      _gnutls_x509_trust_list_add_system_trust in libgnutls.a(certs.o)
  "_SecItemExport", referenced from:
  "_SecItemExport", referenced from:
  "_SecItemExport", referenced from:
      _gnutls_x509_trust_list_add_system_trust in libgnutls.a(certs.o)
      _gnutls_x509_trust_list_add_system_trust in libgnutls.a(certs.o)
      _gnutls_x509_trust_list_add_system_trust in libgnutls.a(certs.o)
  "_SecTrustSettingsCopyCertificates", referenced from:
  "_SecTrustSettingsCopyCertificates", referenced from:
  "_SecTrustSettingsCopyCertificates", referenced from:
      _gnutls_x509_trust_list_add_system_trust in libgnutls.a(certs.o)
      _gnutls_x509_trust_list_add_system_trust in libgnutls.a(certs.o)
      _gnutls_x509_trust_list_add_system_trust in libgnutls.a(certs.o)
ld: symbol(s) not found for architecture x86_64
ld: symbol(s) not found for architecture x86_64
ld: symbol(s) not found for architecture x86_64
clangclang: : error: error: linker command failed with exit code 1 (use -v to see invocation)linker command failed with exit code 1 (use -v to see invocation)

gettext, gnutls and some other mods got removed.

the build_ffmpeg() succeeded and produced a working static compile.. im not sure if the missing modules will make any problems in future since i only want todo some transcoding with it. if anyone interrested in a that final version which runs on my mac's, let me know

for some weired reason this only works on my intel mac machines. if i try to run this on my M1 machines i got

no C compiler found

message. maybe it is because of the arm architecture? or should this also work native ?

JokerGT commented 1 year ago

when i try to perform a shared build i get linker problems for the ffmpeg dylib's:

D   libswresample/libswresample.4.dylib
STRIP   libavcodec/x86/vp9itxfm.o
GEN libavcodec/libavcodec.ver
LD  libavcodec/libavcodec.59.dylib
ld: warning: could not create compact unwind for _ff_cfhd_init_vlcs: stack subq instruction is too different from dwarf stack size
LD  libavformat/libavformat.59.dylib
ld: warning: disabling chained fixups because of unaligned pointers
ld: illegal text-relocation to '___gmpn_add_n' in /Users/tomtom/Code/ffmpeg-windows-build-helpers/sandbox/cross_compilers/native/lib/libgmp.a(add_n.o) from '___gmpn_add_n' in /Users/joker/Code/ffmpeg-windows-build-helpers/sandbox/cross_compilers/native/lib/libgmp.a(add_n.o) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libavformat/libavformat.59.dylib] Error 1

anyone know what is going on here? static builds fine, but not the shared version. i would like to use the dylib a c++ program i made.

rdp commented 1 year ago

this is building native? possibly related: https://stackoverflow.com/questions/11317637/linker-error-when-unit-testing-ld-illegal-text-relocation-to-cstring-in-fr