fluent / fluent-package-builder

td-agent (Fluentd) Building and Packaging System
Apache License 2.0
22 stars 25 forks source link

MacOS M1 builds not working #415

Closed dferreiralopessc closed 1 year ago

dferreiralopessc commented 2 years ago

Hi,

I'm getting issues on deploying td-agent 4.1.x on MacOS m1 computers. Here is the error I get once installed:

/opt/td-agent/lib/ruby/2.7.0/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
    To eliminate this warning, please install libyaml and reinstall your ruby.
    /opt/td-agent/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require': dlopen(/opt/td-agent/lib/ruby/2.7.0/x86_64-darwin20/psych.bundle, 0x0009): Library not loaded: '/usr/local/opt/libyaml/lib/libyaml-0.2.dylib' (LoadError)
      Referenced from: '/opt/td-agent/lib/ruby/2.7.0/x86_64-darwin20/psych.bundle'
      Reason: tried: '/usr/local/opt/libyaml/lib/libyaml-0.2.dylib' (no such file), '/usr/local/lib/libyaml-0.2.dylib' (no such file), '/usr/lib/libyaml-0.2.dylib' (no such file) - /opt/td-agent/lib/ruby/2.7.0/x86_64-darwin20/psych.bundle
        from /opt/td-agent/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /opt/td-agent/lib/ruby/2.7.0/psych.rb:13:in `<top (required)>'
        from /opt/td-agent/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /opt/td-agent/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /opt/td-agent/lib/ruby/2.7.0/yaml.rb:4:in `<top (required)>'
        from /opt/td-agent/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /opt/td-agent/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /opt/td-agent/lib/ruby/2.7.0/rubygems.rb:715:in `load_yaml'
        from /opt/td-agent/lib/ruby/2.7.0/rubygems/config_file.rb:332:in `load_file'
        from /opt/td-agent/lib/ruby/2.7.0/rubygems/config_file.rb:182:in `initialize'
        from /opt/td-agent/lib/ruby/2.7.0/rubygems/gem_runner.rb:79:in `new'
        from /opt/td-agent/lib/ruby/2.7.0/rubygems/gem_runner.rb:79:in `do_configuration'
        from /opt/td-agent/lib/ruby/2.7.0/rubygems/gem_runner.rb:44:in `run'
        from /opt/td-agent/lib/ruby/gems/2.7.0/gems/fluentd-1.15.1/bin/fluent-gem:6:in `<top (required)>'
        from /opt/td-agent/bin/fluent-gem:23:in `load'
        from /opt/td-agent/bin/fluent-gem:23:in `<main>'
    package not found: fluent-plugin-macos-log

With the above, I tried to build the .dmg file from a M1 device but without any success. The process fails and complains that openssl is not found. Here is the output:

making encs
make[1]: Nothing to be done for `encs'.
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems -r./arm64-darwin21-fake ./tool/rbinstall.rb --make="/Library/Developer/CommandLineTools/usr/bin/make" --dest-dir="/Users/ec2-user/fluent-package-builder/td-agent/staging" --extout=".ext" --mflags="- --jobserver-fds=4,5 -j" --make-flags=" --jobserver-fds=4,5 -j -- DESTDIR=/Users/ec2-user/fluent-package-builder/td-agent/staging" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" --exclude=doc
installing binary commands:         /opt/td-agent/bin
installing base libraries:          /opt/td-agent/lib
installing arch files:              /opt/td-agent/lib/ruby/2.7.0/arm64-darwin21
installing pkgconfig data:          /opt/td-agent/lib/pkgconfig
installing extension objects:       /opt/td-agent/lib/ruby/2.7.0/arm64-darwin21
installing extension objects:       /opt/td-agent/lib/ruby/site_ruby/2.7.0/arm64-darwin21
installing extension objects:       /opt/td-agent/lib/ruby/vendor_ruby/2.7.0/arm64-darwin21
installing extension headers:       /opt/td-agent/include/ruby-2.7.0/arm64-darwin21
installing extension scripts:       /opt/td-agent/lib/ruby/2.7.0
installing extension scripts:       /opt/td-agent/lib/ruby/site_ruby/2.7.0
installing extension scripts:       /opt/td-agent/lib/ruby/vendor_ruby/2.7.0
installing extension headers:       /opt/td-agent/include/ruby-2.7.0/ruby
installing command scripts:         /opt/td-agent/bin
installing library scripts:         /opt/td-agent/lib/ruby/2.7.0
installing common headers:          /opt/td-agent/include/ruby-2.7.0
installing manpages:                /opt/td-agent/share/man (man1, man5)
installing default gems from lib:   /opt/td-agent/lib/ruby/gems/2.7.0 (build_info, cache, doc, extensions, gems, specifications)
                                    benchmark 0.1.0
Traceback (most recent call last):
    11: from ./tool/rbinstall.rb:947:in `<main>'
    10: from ./tool/rbinstall.rb:947:in `each'
     9: from ./tool/rbinstall.rb:950:in `block in <main>'
     8: from ./tool/rbinstall.rb:799:in `block in <main>'
     7: from ./tool/rbinstall.rb:835:in `install_default_gem'
     6: from ./tool/rbinstall.rb:835:in `each'
     5: from ./tool/rbinstall.rb:845:in `block in install_default_gem'
     4: from ./tool/rbinstall.rb:279:in `open_for_install'
     3: from ./tool/rbinstall.rb:846:in `block (2 levels) in install_default_gem'
     2: from /Users/ec2-user/fluent-package-builder/td-agent/downloads/ruby-2.7.6/lib/rubygems/specification.rb:2430:in `to_ruby'
     1: from /Users/ec2-user/fluent-package-builder/td-agent/downloads/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
/Users/ec2-user/fluent-package-builder/td-agent/downloads/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- openssl (LoadError)

Here is some information on the device used for the build

Software:

    System Software Overview:

      System Version: macOS 12.4 (21F79)
      Kernel Version: Darwin 21.5.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      User Name: ec2-user (ec2-user)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 2:29

Hardware:

    Hardware Overview:

      Model Name: Mac mini
      Model Identifier: Macmini9,1
      Chip: Apple M1
      Total Number of Cores: 8 (4 performance and 4 efficiency)
      Memory: 16 GB
      System Firmware Version: 7459.121.3
      OS Loader Version: 7459.121.3
      Serial Number (system): H2WH325LQ6NY
      Hardware UUID: 27E95555-852B-5DE9-A1EC-DA011D1E1165
      Provisioning UDID: 00008103-0010282821FB001E
      Activation Lock Status: Disabled

I tried tweaking the command line with paths for the openssl binary/libraries but it did not work. Any idea on how we can solve this?

cosmo0920 commented 2 years ago

@ashie and I discussed with DM about this issue handling. @daipom may take a look this issue.

daipom commented 2 years ago

I will check this problem on my machine!

dferreiralopessc commented 2 years ago

@daipom did you had the chance to look into this? Anything I can do to help?

daipom commented 2 years ago

@dferreiralopessc Sorry for the late response. I will check this issue this weekend! Thanks!

daipom commented 2 years ago

Environment

Try to build

(Uninstall td-agent cleanly.)
$ sudo mkdir /opt/td-agent
$ sudo chown $(whoami) /opt/td-agent
$ rake dmg:selfbuild

Result

The following error occurs at linking ruby. It seems to be an error because openssl can't be found.

linking ruby
*** Following extensions are not compiled:
openssl:
    Could not be configured. It will not be installed.
    /Users/dai/work/fluent-package-builder/td-agent/downloads/ruby-2.7.6/ext/openssl/extconf.rb:96: OpenSSL library could not be found. You might want to use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is installed.
    Check ext/openssl/mkmf.log for more details.
*** Fix the problems, then remove these directories and try again if you want.
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems -r./arm64-darwin21-fake ./tool/rbinstall.rb --make="/Applications/Xcode.app/Contents/Developer/usr/bin/make" --dest-dir="/Users/dai/work/fluent-package-builder/td-agent/staging" --extout=".ext" --mflags="- --jobserver-fds=4,5 -j" --make-flags=" --jobserver-fds=4,5 -j -- DESTDIR=/Users/dai/work/fluent-package-builder/td-agent/staging" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" --exclude=doc
installing binary commands:         /opt/td-agent/bin
installing base libraries:          /opt/td-agent/lib
installing arch files:              /opt/td-agent/lib/ruby/2.7.0/arm64-darwin21
installing pkgconfig data:          /opt/td-agent/lib/pkgconfig
installing extension objects:       /opt/td-agent/lib/ruby/2.7.0/arm64-darwin21
installing extension objects:       /opt/td-agent/lib/ruby/site_ruby/2.7.0/arm64-darwin21
installing extension objects:       /opt/td-agent/lib/ruby/vendor_ruby/2.7.0/arm64-darwin21
installing extension headers:       /opt/td-agent/include/ruby-2.7.0/arm64-darwin21
installing extension scripts:       /opt/td-agent/lib/ruby/2.7.0
installing extension scripts:       /opt/td-agent/lib/ruby/site_ruby/2.7.0
installing extension scripts:       /opt/td-agent/lib/ruby/vendor_ruby/2.7.0
installing extension headers:       /opt/td-agent/include/ruby-2.7.0/ruby
installing command scripts:         /opt/td-agent/bin
installing library scripts:         /opt/td-agent/lib/ruby/2.7.0
installing common headers:          /opt/td-agent/include/ruby-2.7.0
installing manpages:                /opt/td-agent/share/man (man1, man5)
installing default gems from lib:   /opt/td-agent/lib/ruby/gems/2.7.0 (build_info, cache, doc, extensions, gems, specifications)
                                    benchmark 0.1.0
Traceback (most recent call last):
    11: from ./tool/rbinstall.rb:947:in `<main>'
    10: from ./tool/rbinstall.rb:947:in `each'
     9: from ./tool/rbinstall.rb:950:in `block in <main>'
     8: from ./tool/rbinstall.rb:799:in `block in <main>'
     7: from ./tool/rbinstall.rb:835:in `install_default_gem'
     6: from ./tool/rbinstall.rb:835:in `each'
     5: from ./tool/rbinstall.rb:845:in `block in install_default_gem'
     4: from ./tool/rbinstall.rb:279:in `open_for_install'
     3: from ./tool/rbinstall.rb:846:in `block (2 levels) in install_default_gem'
     2: from /Users/dai/work/fluent-package-builder/td-agent/downloads/ruby-2.7.6/lib/rubygems/specification.rb:2430:in `to_ruby'
     1: from /Users/dai/work/fluent-package-builder/td-agent/downloads/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
/Users/dai/work/fluent-package-builder/td-agent/downloads/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- openssl (LoadError)
make: *** [do-install-nodoc] Error 1
rake aborted!
Command failed with status (2): [make install -j8 DESTDIR=/Users/dai/work/f...]
/Users/dai/work/fluent-package-builder/td-agent/Rakefile:827:in `block in build_ruby_from_source'
/Users/dai/work/fluent-package-builder/td-agent/Rakefile:824:in `build_ruby_from_source'
/Users/dai/work/fluent-package-builder/td-agent/Rakefile:444:in `block (2 levels) in define'
Tasks: TOP => dmg:selfbuild => build:all => build:licenses => build:gems => build:ruby_gems => build:fluentd => build:ruby
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/opt/homebrew/Cellar/ruby/3.0.2_1/bin/ruby...]
/Users/dai/work/fluent-package-builder/Rakefile:36:in `block (3 levels) in define_bulked_task'
/Users/dai/work/fluent-package-builder/Rakefile:35:in `block (2 levels) in define_bulked_task'
/Users/dai/work/fluent-package-builder/Rakefile:34:in `each'
/Users/dai/work/fluent-package-builder/Rakefile:34:in `block in define_bulked_task'
Tasks: TOP => dmg:selfbuild
(See full trace by running task with --trace)

The same error as @dferreiralopessc

ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- openssl (LoadError)
daipom commented 2 years ago

Still doing a little digging, but found the following issue.

daipom commented 2 years ago

OpenSSL is installed in my environment.

$ brew list | grep openssl
openssl@1.1
$ which openssl
/usr/bin/openssl
daipom commented 2 years ago

Seems to be related to the problem of not being able to build ruby on M1 macOS.

daipom commented 2 years ago

The error occurs here.

cd /Users/dai/work/fluent-package-builder/td-agent/downloads/ruby-2.7.6
patch -p1 --input=/Users/dai/work/fluent-package-builder/td-agent/patches/ruby-2.7/0001-Removed-the-old-executables-of-racc.patch
patching file bin/racc2y
patching file bin/y2racc
patching file libexec/racc2y
patching file libexec/y2racc
patch -p1 --input=/Users/dai/work/fluent-package-builder/td-agent/patches/ruby-2.7/0002-Fixup-a6864f6d2f39bcd1ff04516591cc18d4027ab186.patch
patching file lib/racc/racc.gemspec
./configure --prefix=/opt/td-agent --enable-shared --disable-install-doc --with-compress-debug-sections=no --without-gmp --without-gdbm --without-tk -C --with-openssl-dir=/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent

I don't understand why this option doesn't work.

I can find openssl.pc at /Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/pkgconfig/openssl.pc.

prefix=/opt/td-agent
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: OpenSSL
Description: Secure Sockets Layer and cryptography libraries and tools
Version: 1.1.1q
Requires: libssl libcrypto
daipom commented 2 years ago

/Users/dai/work/fluent-package-builder/td-agent/downloads/ruby-2.7.6/ext/openssl/mkmf.log

=== OpenSSL for Ruby configurator ===
"gcc -o conftest -I../../.ext/include/arm64-darwin21 -I../.././include -I../.././ext/openssl -I/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -g -O2 -fno-common -pipe conftest.c  -L. -L../.. -L/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib -L. -fstack-protector-strong -L/usr/local/lib  -m64   -lruby.2.7-static -framework Security -framework Foundation -lpthread -ldl -lobjc   "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

"gcc -I../../.ext/include/arm64-darwin21 -I../.././include -I../.././ext/openssl -I/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -g -O2 -fno-common -pipe -m64 -Werror=deprecated-declarations -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
/* end */

=== Checking for system dependent stuff... ===
have_library: checking for t_open() in -lnsl... -------------------- no

"gcc -o conftest -I../../.ext/include/arm64-darwin21 -I../.././include -I../.././ext/openssl -I/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -g -O2 -fno-common -pipe conftest.c  -L. -L../.. -L/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib -L. -fstack-protector-strong -L/usr/local/lib  -m64   -lruby.2.7-static -framework Security -framework Foundation -lpthread -ldl -lobjc -lnsl   "
conftest.c:14:57: error: use of undeclared identifier 't_open'
int t(void) { void ((*volatile p)()); p = (void ((*)()))t_open; return !p; }
                                                        ^
1 error generated.
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     int (* volatile tp)(void)=(int (*)(void))&t;
 9:     printf("%d", (*tp)());
10:   }
11: 
12:   return !!argv[argc];
13: }
14: int t(void) { void ((*volatile p)()); p = (void ((*)()))t_open; return !p; }
/* end */

"gcc -o conftest -I../../.ext/include/arm64-darwin21 -I../.././include -I../.././ext/openssl -I/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -g -O2 -fno-common -pipe conftest.c  -L. -L../.. -L/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib -L. -fstack-protector-strong -L/usr/local/lib  -m64   -lruby.2.7-static -framework Security -framework Foundation -lpthread -ldl -lobjc -lnsl   "
ld: library not found for -lnsl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     int (* volatile tp)(void)=(int (*)(void))&t;
 9:     printf("%d", (*tp)());
10:   }
11: 
12:   return !!argv[argc];
13: }
14: extern void t_open();
15: int t(void) { t_open(); return 0; }
/* end */

--------------------

have_library: checking for socket() in -lsocket... -------------------- no

"gcc -o conftest -I../../.ext/include/arm64-darwin21 -I../.././include -I../.././ext/openssl -I/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -g -O2 -fno-common -pipe conftest.c  -L. -L../.. -L/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib -L. -fstack-protector-strong -L/usr/local/lib  -m64   -lruby.2.7-static -framework Security -framework Foundation -lpthread -ldl -lobjc -lsocket   "
conftest.c:14:57: error: use of undeclared identifier 'socket'
int t(void) { void ((*volatile p)()); p = (void ((*)()))socket; return !p; }
                                                        ^
1 error generated.
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     int (* volatile tp)(void)=(int (*)(void))&t;
 9:     printf("%d", (*tp)());
10:   }
11: 
12:   return !!argv[argc];
13: }
14: int t(void) { void ((*volatile p)()); p = (void ((*)()))socket; return !p; }
/* end */

"gcc -o conftest -I../../.ext/include/arm64-darwin21 -I../.././include -I../.././ext/openssl -I/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -g -O2 -fno-common -pipe conftest.c  -L. -L../.. -L/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib -L. -fstack-protector-strong -L/usr/local/lib  -m64   -lruby.2.7-static -framework Security -framework Foundation -lpthread -ldl -lobjc -lsocket   "
ld: library not found for -lsocket
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     int (* volatile tp)(void)=(int (*)(void))&t;
 9:     printf("%d", (*tp)());
10:   }
11: 
12:   return !!argv[argc];
13: }
14: extern void socket();
15: int t(void) { socket(); return 0; }
/* end */

--------------------

=== Checking for required stuff... ===
"pkg-config --exists openssl"
package configuration for openssl is not found
have_header: checking for openssl/ssl.h... -------------------- yes

"gcc -E -I../../.ext/include/arm64-darwin21 -I../.././include -I../.././ext/openssl -I/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -g -O2 -fno-common -pipe  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <openssl/ssl.h>
/* end */

--------------------

have_library: checking for CRYPTO_malloc() in -lcrypto... -------------------- no

"gcc -o conftest -I../../.ext/include/arm64-darwin21 -I../.././include -I../.././ext/openssl -I/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -g -O2 -fno-common -pipe conftest.c  -L. -L../.. -L/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib -L. -fstack-protector-strong -L/usr/local/lib  -m64   -lruby.2.7-static -framework Security -framework Foundation -lpthread -ldl -lobjc -lcrypto   "
conftest.c:14:57: error: use of undeclared identifier 'CRYPTO_malloc'
int t(void) { void ((*volatile p)()); p = (void ((*)()))CRYPTO_malloc; return !p; }
                                                        ^
1 error generated.
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     int (* volatile tp)(void)=(int (*)(void))&t;
 9:     printf("%d", (*tp)());
10:   }
11: 
12:   return !!argv[argc];
13: }
14: int t(void) { void ((*volatile p)()); p = (void ((*)()))CRYPTO_malloc; return !p; }
/* end */

"gcc -o conftest -I../../.ext/include/arm64-darwin21 -I../.././include -I../.././ext/openssl -I/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -g -O2 -fno-common -pipe conftest.c  -L. -L../.. -L/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib -L. -fstack-protector-strong -L/usr/local/lib  -m64   -lruby.2.7-static -framework Security -framework Foundation -lpthread -ldl -lobjc -lcrypto   "
ld: warning: ignoring file /Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/libcrypto.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "_CRYPTO_malloc", referenced from:
      _t in conftest-951cbf.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     int (* volatile tp)(void)=(int (*)(void))&t;
 9:     printf("%d", (*tp)());
10:   }
11: 
12:   return !!argv[argc];
13: }
14: extern void CRYPTO_malloc();
15: int t(void) { CRYPTO_malloc(); return 0; }
/* end */

--------------------

=== Checking for required stuff failed. ===
Makefile wasn't created. Fix the errors above.
/Users/dai/work/fluent-package-builder/td-agent/downloads/ruby-2.7.6/ext/openssl/extconf.rb:96: OpenSSL library could not be found. You might want to use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is installed.
    /Users/dai/work/fluent-package-builder/td-agent/downloads/ruby-2.7.6/ext/openssl/extconf.rb:96:in `<top (required)>'
    ./ext/extmk.rb:214:in `load'
    ./ext/extmk.rb:214:in `block in extmake'
    /Users/dai/work/fluent-package-builder/td-agent/downloads/ruby-2.7.6/lib/mkmf.rb:331:in `open'
    ./ext/extmk.rb:210:in `extmake'
    ./ext/extmk.rb:572:in `block in <main>'
    ./ext/extmk.rb:568:in `each'
    ./ext/extmk.rb:568:in `<main>'
daipom commented 2 years ago

When I use my Rosetta environment on the same machine, the build succeeds.

daipom commented 2 years ago

@dferreiralopessc

I'm getting issues on deploying td-agent 4.1.x on MacOS m1 computers. Here is the error I get once installed:

Not related to the building, td-agent v4.1.1 launched without error in my M1 mac.

$ td-agent --version
td-agent 4.4.1 fluentd 1.15.2 (c32842297ed2c306f1b841a8f6e55bdd0f1cb27f)

Did you get the error just installing and launching?

daipom commented 2 years ago

Oh, sorry, I had mistaken it for 4.4.x. You get the error on 4.1.x. I will check it too.

daipom commented 1 year ago

@dferreiralopessc

I'm getting issues on deploying td-agent 4.1.x on MacOS m1 computers. Here is the error I get once installed:

Not related to the building, td-agent v4.1.1 launched without error in my M1 mac.

$ td-agent --version
td-agent 4.4.1 fluentd 1.15.2 (c32842297ed2c306f1b841a8f6e55bdd0f1cb27f)

Did you get the error just installing and launching?

Oh, sorry, I had mistaken it for 4.4.x. You get the error on 4.1.x. I will check it too.

I checked td-agent v4.1.1 on my M1 MacBook, and it launched without error after all. Did you get the error just installing and launching?

ashie commented 1 year ago
ld: warning: ignoring file /Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/libcrypto.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "_CRYPTO_malloc", referenced from:
      _t in conftest-951cbf.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I got it.

https://github.com/fluent/fluent-package-builder/blob/2165980aea141af9e24ebda39918ba062159b302/td-agent/Rakefile#L786-L788

It should be darwin64-arm64-cc.

daipom commented 1 year ago

Oh!! Thanks!! I will try changing this option.

daipom commented 1 year ago

I am also concerned here.

https://github.com/fluent/fluent-package-builder/blob/2165980aea141af9e24ebda39918ba062159b302/td-agent/Rakefile#L339

daipom commented 1 year ago

I am also concerned here.

https://github.com/fluent/fluent-package-builder/blob/2165980aea141af9e24ebda39918ba062159b302/td-agent/Rakefile#L339

I'm not sure, but it seems fine here.

ld: warning: ignoring file /Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/libcrypto.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "_CRYPTO_malloc", referenced from:
      _t in conftest-951cbf.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I got it.

https://github.com/fluent/fluent-package-builder/blob/2165980aea141af9e24ebda39918ba062159b302/td-agent/Rakefile#L786-L788

It should be darwin64-arm64-cc.

I tried this and succeeded in OpenSSL, but I found another error about rdkafka in bundle install.

/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/bin/bundle _2.3.18_ install
Fetching source index from file:///Users/dai/work/fluent-package-builder/td-agent/local_gem_repo/
Fetching gem metadata from https://rubygems.org/...........
Fetching source index from https://rubygems.org/
Resolving dependencies...
Fetching rake 13.0.6
Installing rake 13.0.6

{omit}

Fetching fluent-diagtool 1.0.1
Installing fluent-diagtool 1.0.1
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/rdkafka-0.11.1/ext
/opt/td-agent/bin/ruby -I/opt/td-agent/lib/ruby/2.7.0/rubygems -rrubygems
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/rake-13.0.6/exe/rake
RUBYARCHDIR\=/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0/rdkafka-0.11.1
RUBYLIBDIR\=/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0/rdkafka-0.11.1
Downloading v1.8.2 (  0%)

{omit}

Downloading v1.8.2 (100%)
Extracting v1.8.2 into tmp/arm64-apple-darwin21.4.0/ports/librdkafka/1.8.2... OK
Running 'configure' for librdkafka 1.8.2... OK
Running 'compile' for librdkafka 1.8.2... ERROR, review
'/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/rdkafka-0.11.1/ext/tmp/arm64-apple-darwin21.4.0/ports/librdkafka/1.8.2/compile.log'
to see what happened. Last lines are:
========================================================================
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
      _rd_kafka_transport_ssl_cert_verify_cb in rdkafka_ssl.o
  "_X509_new", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_X509_verify_cert_error_string", referenced from:
      _rd_kafka_transport_ssl_handshake in rdkafka_ssl.o
  "_d2i_PKCS12_bio", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
  "_d2i_PKCS12_fp", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_d2i_PrivateKey_bio", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
  "_d2i_X509_bio", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
  "_i2d_X509", referenced from:
      _rd_kafka_transport_ssl_cert_verify_cb in rdkafka_ssl.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [librdkafka.1.dylib] Error 1
make: *** [libs] Error 2
========================================================================
rake aborted!
Failed to complete compile task
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/mini_portile2-2.8.0/lib/mini_portile2/mini_portile.rb:460:in
`block in execute'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/mini_portile2-2.8.0/lib/mini_portile2/mini_portile.rb:426:in
`chdir'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/mini_portile2-2.8.0/lib/mini_portile2/mini_portile.rb:426:in
`execute'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/mini_portile2-2.8.0/lib/mini_portile2/mini_portile.rb:144:in
`compile'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/mini_portile2-2.8.0/lib/mini_portile2/mini_portile.rb:187:in
`cook'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/rdkafka-0.11.1/ext/Rakefile:22:in `block in <top (required)>'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<main>'
Tasks: TOP => default
(See full trace by running task with --trace)

rake failed, exit code 1

Gem files will remain installed in /Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/rdkafka-0.11.1 for
inspection.
Results logged to
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0/rdkafka-0.11.1/gem_make.out

  /opt/td-agent/lib/ruby/2.7.0/rubygems/ext/builder.rb:99:in `run'
  /opt/td-agent/lib/ruby/2.7.0/rubygems/ext/rake_builder.rb:30:in `build'
  /opt/td-agent/lib/ruby/2.7.0/rubygems/ext/builder.rb:169:in `block in build_extension'
  /opt/td-agent/lib/ruby/2.7.0/rubygems/ext/builder.rb:165:in `synchronize'
  /opt/td-agent/lib/ruby/2.7.0/rubygems/ext/builder.rb:165:in `build_extension'
  /opt/td-agent/lib/ruby/2.7.0/rubygems/ext/builder.rb:210:in `block in build_extensions'
  /opt/td-agent/lib/ruby/2.7.0/rubygems/ext/builder.rb:207:in `each'
  /opt/td-agent/lib/ruby/2.7.0/rubygems/ext/builder.rb:207:in `build_extensions'
  /opt/td-agent/lib/ruby/2.7.0/rubygems/installer.rb:844:in `build_extensions'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/rubygems_gem_installer.rb:71:in
`build_extensions'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
  /Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/source/rubygems.rb:207:in `install'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/installer/gem_installer.rb:54:in
`install'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/installer/parallel_installer.rb:186:in
`do_install'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/installer/parallel_installer.rb:177:in
`block in worker_pool'
  /Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/worker.rb:62:in `apply_func'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/worker.rb:57:in `block in
process_queue'
  /Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/worker.rb:54:in `loop'
  /Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/worker.rb:54:in `process_queue'
/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/worker.rb:91:in `block (2 levels)
in create_threads'

An error occurred while installing rdkafka (0.11.1), and Bundler cannot continue.

In Gemfile:
  rdkafka
rake aborted!
Command failed with status (5): [/Users/dai/work/fluent-package-builder/td-...]
/Users/dai/work/fluent-package-builder/td-agent/Rakefile:463:in `block (2 levels) in define'
Tasks: TOP => dmg:selfbuild => build:all => build:licenses => build:gems => build:ruby_gems
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/opt/homebrew/Cellar/ruby/3.0.2_1/bin/ruby...]
/Users/dai/work/fluent-package-builder/Rakefile:36:in `block (3 levels) in define_bulked_task'
/Users/dai/work/fluent-package-builder/Rakefile:35:in `block (2 levels) in define_bulked_task'
/Users/dai/work/fluent-package-builder/Rakefile:34:in `each'
/Users/dai/work/fluent-package-builder/Rakefile:34:in `block in define_bulked_task'
Tasks: TOP => dmg:selfbuild
(See full trace by running task with --trace)
daipom commented 1 year ago

/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/rdkafka-0.11.1/ext/tmp/arm64-apple-darwin21.4.0/ports/librdkafka/1.8.2/compile.log

gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka.c -o rdkafka.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_broker.c -o rdkafka_broker.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_msg.c -o rdkafka_msg.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_topic.c -o rdkafka_topic.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_conf.c -o rdkafka_conf.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_timer.c -o rdkafka_timer.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_offset.c -o rdkafka_offset.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_transport.c -o rdkafka_transport.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_buf.c -o rdkafka_buf.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_queue.c -o rdkafka_queue.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_op.c -o rdkafka_op.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_request.c -o rdkafka_request.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_cgrp.c -o rdkafka_cgrp.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_pattern.c -o rdkafka_pattern.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_partition.c -o rdkafka_partition.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_subscription.c -o rdkafka_subscription.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_assignment.c -o rdkafka_assignment.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_assignor.c -o rdkafka_assignor.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_range_assignor.c -o rdkafka_range_assignor.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_roundrobin_assignor.c -o rdkafka_roundrobin_assignor.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_sticky_assignor.c -o rdkafka_sticky_assignor.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_feature.c -o rdkafka_feature.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdcrc32.c -o rdcrc32.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c crc32c.c -o crc32c.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdmurmur2.c -o rdmurmur2.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdfnv1a.c -o rdfnv1a.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdaddr.c -o rdaddr.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdrand.c -o rdrand.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdlist.c -o rdlist.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c tinycthread.c -o tinycthread.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c tinycthread_extra.c -o tinycthread_extra.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdlog.c -o rdlog.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdstring.c -o rdstring.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_event.c -o rdkafka_event.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_metadata.c -o rdkafka_metadata.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdregex.c -o rdregex.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdports.c -o rdports.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_metadata_cache.c -o rdkafka_metadata_cache.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdavl.c -o rdavl.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_sasl.c -o rdkafka_sasl.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_sasl_plain.c -o rdkafka_sasl_plain.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_interceptor.c -o rdkafka_interceptor.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_msgset_writer.c -o rdkafka_msgset_writer.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_msgset_reader.c -o rdkafka_msgset_reader.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_header.c -o rdkafka_header.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_admin.c -o rdkafka_admin.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_aux.c -o rdkafka_aux.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_background.c -o rdkafka_background.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_idempotence.c -o rdkafka_idempotence.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_cert.c -o rdkafka_cert.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_txnmgr.c -o rdkafka_txnmgr.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_coord.c -o rdkafka_coord.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdvarint.c -o rdvarint.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdbuf.c -o rdbuf.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdmap.c -o rdmap.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdunittest.c -o rdunittest.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_mock.c -o rdkafka_mock.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_mock_handlers.c -o rdkafka_mock_handlers.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_mock_cgrp.c -o rdkafka_mock_cgrp.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_error.c -o rdkafka_error.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_sasl_cyrus.c -o rdkafka_sasl_cyrus.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_sasl_scram.c -o rdkafka_sasl_scram.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_sasl_oauthbearer.c -o rdkafka_sasl_oauthbearer.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c snappy.c -o snappy.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdgz.c -o rdgz.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_zstd.c -o rdkafka_zstd.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdhdrhistogram.c -o rdhdrhistogram.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_ssl.c -o rdkafka_ssl.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_lz4.c -o rdkafka_lz4.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -O3 -c rdxxhash.c -o rdxxhash.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rddl.c -o rddl.o
gcc -MD -MP -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/usr/local/Cellar/openssl@1.1/1.1.1q/include -I/opt/homebrew/Cellar/zstd/1.5.0/include -I/opt/homebrew/Cellar/lz4/1.9.3/include -c rdkafka_plugin.c -o rdkafka_plugin.o
Creating shared library librdkafka.1.dylib(B
gcc  -shared -dynamiclib -Wl,-install_name,/Users/dai/work/fluent-package-builder/td-agent/staging/opt/td-agent/lib/ruby/gems/2.7.0/gems/rdkafka-0.11.1/ext/ports/arm64-apple-darwin21.4.0/librdkafka/1.8.2/lib/librdkafka.1.dylib rdkafka.o rdkafka_broker.o rdkafka_msg.o rdkafka_topic.o rdkafka_conf.o rdkafka_timer.o rdkafka_offset.o rdkafka_transport.o rdkafka_buf.o rdkafka_queue.o rdkafka_op.o rdkafka_request.o rdkafka_cgrp.o rdkafka_pattern.o rdkafka_partition.o rdkafka_subscription.o rdkafka_assignment.o rdkafka_assignor.o rdkafka_range_assignor.o rdkafka_roundrobin_assignor.o rdkafka_sticky_assignor.o rdkafka_feature.o rdcrc32.o crc32c.o rdmurmur2.o rdfnv1a.o rdaddr.o rdrand.o rdlist.o tinycthread.o tinycthread_extra.o rdlog.o rdstring.o rdkafka_event.o rdkafka_metadata.o rdregex.o rdports.o rdkafka_metadata_cache.o rdavl.o rdkafka_sasl.o rdkafka_sasl_plain.o rdkafka_interceptor.o rdkafka_msgset_writer.o rdkafka_msgset_reader.o rdkafka_header.o rdkafka_admin.o rdkafka_aux.o rdkafka_background.o rdkafka_idempotence.o rdkafka_cert.o rdkafka_txnmgr.o rdkafka_coord.o rdvarint.o rdbuf.o rdmap.o rdunittest.o rdkafka_mock.o rdkafka_mock_handlers.o rdkafka_mock_cgrp.o rdkafka_error.o rdkafka_sasl_cyrus.o rdkafka_sasl_scram.o rdkafka_sasl_oauthbearer.o snappy.o rdgz.o rdkafka_zstd.o rdhdrhistogram.o rdkafka_ssl.o rdkafka_lz4.o rdxxhash.o rddl.o rdkafka_plugin.o -o librdkafka.1.dylib -L/opt/homebrew/Cellar/lz4/1.9.3/lib -llz4 -lm -L/opt/homebrew/Cellar/zstd/1.5.0/lib -lzstd -lsasl2 -L/usr/local/Cellar/openssl@1.1/1.1.1q/lib -lssl -L/usr/local/Cellar/openssl@1.1/1.1.1q/lib -lcrypto -lz -ldl -lpthread
ld: warning: ignoring file /usr/local/Cellar/openssl@1.1/1.1.1q/lib/libcrypto.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/Cellar/openssl@1.1/1.1.1q/lib/libssl.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "_BIO_ctrl", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
  "_BIO_free", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_BIO_new_mem_buf", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_CRYPTO_free", referenced from:
      _rd_kafka_transport_ssl_cert_verify_cb in rdkafka_ssl.o
  "_ENGINE_by_id", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_ENGINE_ctrl_cmd_string", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_ENGINE_free", referenced from:
      _rd_kafka_ssl_ctx_term in rdkafka_ssl.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_ENGINE_init", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_ENGINE_load_ssl_client_cert", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_ERR_clear_error", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
      _rd_kafka_transport_ssl_send in rdkafka_ssl.o
      _rd_kafka_transport_ssl_recv in rdkafka_ssl.o
      _rd_kafka_transport_ssl_connect in rdkafka_ssl.o
  "_ERR_error_string_n", referenced from:
      _rd_kafka_ssl_error in rdkafka_ssl.o
  "_ERR_func_error_string", referenced from:
      _rd_kafka_ssl_last_error_str in rdkafka_ssl.o
  "_ERR_get_error_line_data", referenced from:
      _rd_kafka_ssl_error in rdkafka_ssl.o
  "_ERR_lib_error_string", referenced from:
      _rd_kafka_ssl_last_error_str in rdkafka_ssl.o
  "_ERR_peek_error", referenced from:
      _rd_kafka_transport_ssl_io_update in rdkafka_ssl.o
  "_ERR_peek_last_error_line_data", referenced from:
      _rd_kafka_ssl_last_error_str in rdkafka_ssl.o
  "_ERR_reason_error_string", referenced from:
      _rd_kafka_ssl_last_error_str in rdkafka_ssl.o
  "_EVP_DecodeBlock", referenced from:
      _rd_kafka_sasl_scram_fsm in rdkafka_sasl_scram.o
  "_EVP_EncodeBlock", referenced from:
      _rd_kafka_sasl_scram_build_client_final_message in rdkafka_sasl_scram.o
      _rd_kafka_oauthbearer_unsecured_token0 in rdkafka_sasl_oauthbearer.o
  "_EVP_PKEY_free", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
      _rd_kafka_cert_destroy in rdkafka_cert.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_EVP_PKEY_new", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_EVP_sha1", referenced from:
      _rd_kafka_sasl_scram_conf_validate in rdkafka_sasl_scram.o
  "_EVP_sha256", referenced from:
      _rd_kafka_sasl_scram_conf_validate in rdkafka_sasl_scram.o
  "_EVP_sha512", referenced from:
      _rd_kafka_sasl_scram_conf_validate in rdkafka_sasl_scram.o
  "_HMAC", referenced from:
      _rd_kafka_sasl_scram_Hi in rdkafka_sasl_scram.o
      _rd_kafka_sasl_scram_HMAC in rdkafka_sasl_scram.o
  "_OPENSSL_sk_free", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_OPENSSL_sk_new_null", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_OPENSSL_sk_num", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_OPENSSL_sk_pop_free", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_OPENSSL_sk_push", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_OPENSSL_sk_value", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_OpenSSL_version", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_OpenSSL_version_num", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_PEM_read_bio_PrivateKey", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_PEM_read_bio_X509", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_PKCS12_free", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_PKCS12_parse", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SHA1", referenced from:
      _rd_kafka_sasl_scram_conf_validate in rdkafka_sasl_scram.o
  "_SHA256", referenced from:
      _rd_kafka_sasl_scram_conf_validate in rdkafka_sasl_scram.o
  "_SHA512", referenced from:
      _rd_kafka_sasl_scram_conf_validate in rdkafka_sasl_scram.o
  "_SSL_CTX_check_private_key", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_ctrl", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_free", referenced from:
      _rd_kafka_ssl_ctx_term in rdkafka_ssl.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_get_cert_store", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_load_verify_locations", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_new", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_set_cert_store", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_set_cipher_list", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_set_default_passwd_cb", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_set_default_passwd_cb_userdata", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_set_default_verify_paths", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_set_options", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_set_verify", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_use_PrivateKey", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_use_PrivateKey_file", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_use_certificate", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_CTX_use_certificate_chain_file", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_SSL_connect", referenced from:
      _rd_kafka_transport_ssl_connect in rdkafka_ssl.o
  "_SSL_ctrl", referenced from:
      _rd_kafka_transport_ssl_connect in rdkafka_ssl.o
  "_SSL_do_handshake", referenced from:
      _rd_kafka_transport_ssl_handshake in rdkafka_ssl.o
  "_SSL_free", referenced from:
      _rd_kafka_transport_ssl_close in rdkafka_ssl.o
  "_SSL_get_error", referenced from:
      _rd_kafka_transport_ssl_io_update in rdkafka_ssl.o
  "_SSL_get_peer_certificate", referenced from:
      _rd_kafka_transport_ssl_handshake in rdkafka_ssl.o
  "_SSL_get_verify_result", referenced from:
      _rd_kafka_transport_ssl_handshake in rdkafka_ssl.o
  "_SSL_new", referenced from:
      _rd_kafka_transport_ssl_connect in rdkafka_ssl.o
  "_SSL_read", referenced from:
      _rd_kafka_transport_ssl_recv in rdkafka_ssl.o
  "_SSL_set1_host", referenced from:
      _rd_kafka_transport_ssl_connect in rdkafka_ssl.o
  "_SSL_set_fd", referenced from:
      _rd_kafka_transport_ssl_connect in rdkafka_ssl.o
  "_SSL_shutdown", referenced from:
      _rd_kafka_transport_ssl_close in rdkafka_ssl.o
  "_SSL_write", referenced from:
      _rd_kafka_transport_ssl_send in rdkafka_ssl.o
  "_TLS_client_method", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_X509_NAME_oneline", referenced from:
      _rd_kafka_transport_ssl_cert_verify_cb in rdkafka_ssl.o
  "_X509_OBJECT_get0_X509", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_X509_STORE_CTX_get_current_cert", referenced from:
      _rd_kafka_transport_ssl_cert_verify_cb in rdkafka_ssl.o
  "_X509_STORE_CTX_get_error", referenced from:
      _rd_kafka_transport_ssl_cert_verify_cb in rdkafka_ssl.o
  "_X509_STORE_CTX_get_error_depth", referenced from:
      _rd_kafka_transport_ssl_cert_verify_cb in rdkafka_ssl.o
  "_X509_STORE_CTX_set_error", referenced from:
      _rd_kafka_transport_ssl_cert_verify_cb in rdkafka_ssl.o
  "_X509_STORE_add_cert", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_X509_STORE_free", referenced from:
      _rd_kafka_cert_destroy in rdkafka_cert.o
  "_X509_STORE_get0_objects", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_X509_STORE_new", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
  "_X509_STORE_set_flags", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_X509_free", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
      _rd_kafka_cert_destroy in rdkafka_cert.o
      _rd_kafka_transport_ssl_handshake in rdkafka_ssl.o
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_X509_get_issuer_name", referenced from:
      _rd_kafka_transport_ssl_cert_verify_cb in rdkafka_ssl.o
  "_X509_get_subject_name", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
      _rd_kafka_transport_ssl_cert_verify_cb in rdkafka_ssl.o
  "_X509_new", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_X509_verify_cert_error_string", referenced from:
      _rd_kafka_transport_ssl_handshake in rdkafka_ssl.o
  "_d2i_PKCS12_bio", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
  "_d2i_PKCS12_fp", referenced from:
      _rd_kafka_ssl_ctx_init in rdkafka_ssl.o
  "_d2i_PrivateKey_bio", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
  "_d2i_X509_bio", referenced from:
      _rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
  "_i2d_X509", referenced from:
      _rd_kafka_transport_ssl_cert_verify_cb in rdkafka_ssl.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [librdkafka.1.dylib] Error 1
make: *** [libs] Error 2
daipom commented 1 year ago

Hmm, Hmm, it seems to still be OpenSSL problem.

ld: warning: ignoring file /usr/local/Cellar/openssl@1.1/1.1.1q/lib/libcrypto.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/Cellar/openssl@1.1/1.1.1q/lib/libssl.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
ashie commented 1 year ago

Probably you need to clean up your build directory by rake clobber.

ashie commented 1 year ago

I am also concerned here.

https://github.com/fluent/fluent-package-builder/blob/2165980aea141af9e24ebda39918ba062159b302/td-agent/Rakefile#L339

It's no problem, it's for Windows. We have no plan to support Windows for Arm.

daipom commented 1 year ago

I am also concerned here. https://github.com/fluent/fluent-package-builder/blob/2165980aea141af9e24ebda39918ba062159b302/td-agent/Rakefile#L339

It's no problem, it's for Windows. We have no plan to support Windows for Arm.

I see! Thanks!

Probably you need to clean up your build directory by rake clobber.

I'm using both arm64 and x86_64(Rosetta) environments, but there was a mistake in the setting. Somehow the x86_64 OpenSSL libraries paths are used for building kafka.

I fixed my environment, and I succeeded in building td-agent v4.4.1 on my arm64 environment finally.

Thanks so much!

ashie commented 1 year ago

I've merged the fix but not yet upload the built package. Need to test it a bit more.

ashie commented 1 year ago

We released td-agent-4.4.2-arm64.dmg. https://td-agent-package-browser.herokuapp.com/4/macosx

dferreiralopessc commented 1 year ago

Thanks a ton @ashie, I'll go ahead and test the deployment!