facebook / redex

A bytecode optimizer for Android apps
https://fbredex.com/
MIT License
6.02k stars 654 forks source link

redex build failed #877

Open xuweishun opened 1 month ago

xuweishun commented 1 month ago

autoreconf -ivf && ./configure && make

errorlog: p -fno-common -DPIC -o checkers/.libs/DexLimitsChecker.o In file included from checkers/DexLimitsChecker.cpp:8: In file included from ./checkers/DexLimitsChecker.h:10: In file included from ./libredex/RedexPropertyChecker.h:12: In file included from ./libredex/DexStore.h:17: In file included from ./libredex/ConcurrentContainers.h:10: In file included from /usr/local/include/boost/intrusive/pointer_plus_bits.hpp:18: In file included from /usr/local/include/boost/intrusive/detail/mpl.hpp:26: /usr/local/include/boost/move/detail/type_traits.hpp:805:30: error: builtin has_trivial_destructor is deprecated; use is_trivially_destructible instead [-Werror,-Wdeprecated-builtins] { static const bool value = BOOST_MOVE_IS_TRIVIALLY_DESTRUCTIBLE(T); }; ^ /usr/local/include/boost/move/detail/type_traits.hpp:272:54: note: expanded from macro 'BOOST_MOVE_IS_TRIVIALLY_DESTRUCTIBLE'

define BOOST_MOVE_IS_TRIVIALLY_DESTRUCTIBLE(T) BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR(T)

                                                 ^

/usr/local/include/boost/move/detail/type_traits.hpp:128:51: note: expanded from macro 'BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR'

define BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)

                                              ^

/usr/local/include/boost/move/detail/type_traits.hpp:812:30: error: builtin has_trivial_constructor is deprecated; use is_trivially_constructible instead [-Werror,-Wdeprecated-builtins] { static const bool value = BOOST_MOVE_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE(T); }; ^ /usr/local/include/boost/move/detail/type_traits.hpp:246:62: note: expanded from macro 'BOOST_MOVE_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE'

define BOOST_MOVE_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE(T) BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T)

                                                         ^

/usr/local/include/boost/move/detail/type_traits.hpp:119:52: note: expanded from macro 'BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR'

define BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)

                                               ^

/usr/local/include/boost/move/detail/type_traits.hpp:822:30: error: builtin has_trivial_copy is deprecated; use is_trivially_copyable instead [-Werror,-Wdeprecated-builtins] static const bool value = BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T); ^ /usr/local/include/boost/move/detail/type_traits.hpp:240:60: note: expanded from macro 'BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE' BOOST_MOVE_HAS_TRIVIAL_COPY(T)) ^ /usr/local/include/boost/move/detail/type_traits.hpp:122:45: note: expanded from macro 'BOOST_MOVE_HAS_TRIVIAL_COPY'

define BOOST_MOVE_HAS_TRIVIAL_COPY(T) __has_trivial_copy(T)

                                        ^

/usr/local/include/boost/move/detail/type_traits.hpp:840:30: error: builtin has_trivial_assign is deprecated; use is_trivially_assignable instead [-Werror,-Wdeprecated-builtins] static const bool value = BOOST_MOVE_IS_TRIVIALLY_COPY_ASSIGNABLE(T); ^ /usr/local/include/boost/move/detail/type_traits.hpp:260:58: note: expanded from macro 'BOOST_MOVE_IS_TRIVIALLY_COPY_ASSIGNABLE' BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T)) ^ /usr/local/include/boost/move/detail/type_traits.hpp:125:48: note: expanded from macro 'BOOST_MOVE_HAS_TRIVIAL_ASSIGN'

define BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) )

                                           ^

/usr/local/include/boost/move/detail/type_traits.hpp:856:30: error: builtin has_nothrow_constructor is deprecated; use is_nothrow_constructible instead [-Werror,-Wdeprecated-builtins] { static const bool value = BOOST_MOVE_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE(T); }; ^ /usr/local/include/boost/move/detail/type_traits.hpp:278:60: note: expanded from macro 'BOOST_MOVE_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE'

define BOOST_MOVE_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE(T) BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR(T)

                                                       ^

/usr/local/include/boost/move/detail/type_traits.hpp:131:52: note: expanded from macro 'BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR'

define BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)

                                               ^

/usr/local/include/boost/move/detail/type_traits.hpp:863:30: error: builtin has_nothrow_copy is deprecated; use is_nothrow_constructible instead [-Werror,-Wdeprecated-builtins] { static const bool value = BOOST_MOVE_IS_NOTHROW_COPY_CONSTRUCTIBLE(T); }; ^ /usr/local/include/boost/move/detail/type_traits.hpp:284:58: note: expanded from macro 'BOOST_MOVE_IS_NOTHROW_COPY_CONSTRUCTIBLE'

define BOOST_MOVE_IS_NOTHROW_COPY_CONSTRUCTIBLE(T) BOOST_MOVE_HAS_NOTHROW_COPY(T)

                                                     ^

/usr/local/include/boost/move/detail/type_traits.hpp:134:46: note: expanded from macro 'BOOST_MOVE_HAS_NOTHROW_COPY'

define BOOST_MOVE_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T))

                                         ^

In file included from checkers/DexLimitsChecker.cpp:8: In file included from ./checkers/DexLimitsChecker.h:10: In file included from ./libredex/RedexPropertyChecker.h:12: In file included from ./libredex/DexStore.h:19: In file included from ./libredex/DexClass.h:25: In file included from ./libredex/DexMemberRefs.h:10: In file included from /usr/local/include/boost/functional/hash.hpp:6: /usr/local/include/boost/container_hash/hash.hpp:130:33: error: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'? struct hash_base : std::unary_function<T, std::size_t> {};


                                __unary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/unary_function.h:46:1: note: '__unary_function' declared here
using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
^
In file included from checkers/DexLimitsChecker.cpp:8:
In file included from ./checkers/DexLimitsChecker.h:10:
In file included from ./libredex/RedexPropertyChecker.h:12:
In file included from ./libredex/DexStore.h:19:
In file included from ./libredex/DexClass.h:27:
In file included from ./libredex/ReferencedState.h:11:
In file included from /usr/local/include/boost/optional.hpp:15:
In file included from /usr/local/include/boost/optional/optional.hpp:38:
/usr/local/include/boost/type_traits/has_nothrow_constructor.hpp:27:84: error: builtin __has_nothrow_constructor is deprecated; use __is_nothrow_constructible instead [-Werror,-Wdeprecated-builtins]
template <class T> struct has_nothrow_constructor : public integral_constant<bool, BOOST_HAS_NOTHROW_CONSTRUCTOR(T)>{};
                                                                                   ^
/usr/local/include/boost/type_traits/intrinsics.hpp:199:48: note: expanded from macro 'BOOST_HAS_NOTHROW_CONSTRUCTOR'
#     define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible<T>::value)
                                               ^
In file included from checkers/DexLimitsChecker.cpp:8:
In file included from ./checkers/DexLimitsChecker.h:10:
In file included from ./libredex/RedexPropertyChecker.h:12:
In file included from ./libredex/DexStore.h:19:
In file included from ./libredex/DexClass.h:27:
In file included from ./libredex/ReferencedState.h:11:
In file included from /usr/local/include/boost/optional.hpp:15:
In file included from /usr/local/include/boost/optional/optional.hpp:47:
In file included from /usr/local/include/boost/type_traits/is_nothrow_move_assignable.hpp:16:
/usr/local/include/boost/type_traits/has_nothrow_assign.hpp:65:7: error: builtin __has_nothrow_assign is deprecated; use __is_nothrow_assignable instead [-Werror,-Wdeprecated-builtins]
      BOOST_HAS_NOTHROW_ASSIGN(T)
      ^
/usr/local/include/boost/type_traits/intrinsics.hpp:205:43: note: expanded from macro 'BOOST_HAS_NOTHROW_ASSIGN'
#     define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
                                          ^
9 errors generated.
make[2]: *** [checkers/DexLimitsChecker.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
wsanville commented 1 month ago

Can you add some more information, including:

xuweishun commented 1 month ago

Can you add some more information, including:

  • What OS/compiler and version you are running.
  • How was boost installed? Did you run setup_oss_toolchain.sh ?

eg: redex branch: main Apple M1 Pro,OS 14.5 (23F79); Version 15.4 (15F31d) boost 1.17.0 has installed; I have already executed 'sh setup_oss_toolchain.sh '

image

(base) admin@xuweishunM1 redex % sh ./setup_oss_toolchain.sh toolchain tmp = grep: /etc/os-release: No such file or directory ANDROID_HOME=/Users/xuweishun/Library/Android/sdk BASH=/bin/sh BASH_ARGC=() BASH_ARGV=() BASH_LINENO=([0]="0") BASH_SOURCE=([0]="./setup_oss_toolchain.sh") BASH_VERSINFO=([0]="3" [1]="2" [2]="57" [3]="1" [4]="release" [5]="arm64-apple-darwin23") BASH_VERSION='3.2.57(1)-release' BITNESS=64 BITNESS_CONFIGURE= BITNESS_PKGS= BITNESS_SUFFIX=: BOOST_DEB_UBUNTU_PKGS='libboost-filesystem-dev: libboost-iostreams-dev: libboost-program-options-dev: libboost-regex-dev: libboost-system-dev: libboost-thread-dev:' BOOST_LDFLAGS=/usr/local/include/boost_1_71_0 BOOST_ROOT=/usr/local/include/boost_1_71_0 COLORTERM=truecolor COMMAND_MODE=unix2003 CONDA_DEFAULT_ENV=base CONDA_EXE=/Users/xuweishun/miniconda3/bin/conda CONDA_PREFIX=/Users/xuweishun/miniconda3 CONDA_PROMPT_MODIFIER='(base) ' CONDA_PYTHON_EXE=/Users/xuweishun/miniconda3/bin/python CONDA_SHLVL=1 DEB_UBUNTU_PKGS=unzip DIRSTACK=() EUID=501 FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn GIT_ASKPASS='/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass.sh' GRADLEPROFILER_HOME=/Users/xuweishun/.sdkman/candidates/gradleprofiler/current GROUPS=() HOME=/Users/xuweishun HOSTNAME=xuweishunM1.local HOSTTYPE=arm64 IFS=' ' JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home LANG=zh_CN.UTF-8 LOGNAME=admin MACHTYPE=arm64-apple-darwin23 MallocNanoZone=0 NVM_BIN=/Users/xuweishun/.nvm/versions/node/v14.21.1/bin NVM_CD_FLAGS=-q NVM_DIR=/Users/xuweishun/.nvm NVM_INC=/Users/xuweishun/.nvm/versions/node/v14.21.1/include/node OPTERR=1 OPTIND=1 ORIGINAL_XDG_CURRENT_DESKTOP=undefined OSTYPE=darwin23 PATH=/Users/xuweishun/.nvm/versions/node/v14.21.1/bin:/Users/xuweishun/Library/Python/3.9/bin:/Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home/bin:/Users/xuweishun/Documents/flutter/bin/cache/dart-sdk/bin:/Users/xuweishun/Documents/flutter/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/xuweishun/Documents/flutter/bin/cache/dart-sdk/bin:/Users/xuweishun/miniconda3/bin:/Users/xuweishun/miniconda3/condabin:/Users/xuweishun/.sdkman/candidates/gradleprofiler/current/bin:/Users/xuweishun/.nvm/versions/node/v14.21.1/bin:/Users/xuweishun/Library/Python/3.9/bin:/Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home/bin:/Users/xuweishun/Documents/flutter/bin/cache/dart-sdk/bin:/Users/xuweishun/Documents/flutter/bin:/Users/xuweishun/.cargo/bin:/Users/xuweishun/Library/Android/sdk/platform-tools:/Users/xuweishun/Library/Android/sdk/build-tools/30.0.3:/Users/xuweishun/.pub-cache/bin:/Users/xuweishun/bin:/opt/homebrew/bin:/Users/xuweishun/Library/Android/sdk/platform-tools:/Users/xuweishun/Library/Android/sdk/build-tools/30.0.3:/Users/xuweishun/.pub-cache/bin:/Users/xuweishun/.pub-cache/bin:/Users/xuweishun/bin:/Users/xuweishun/Library/Android/sdk/platform-tools:/usr/local/bin:/opt/homebrew/bin PIPESTATUS=([0]="0") POSIXLY_CORRECT=y PPID=3786 PROTOBUF_DEB_UBUNTU_PKGS='libprotobuf-dev: protobuf-compiler' PS4='+ ' PUB_HOSTED_URL=https://pub.flutter-io.cn PWD=/Users/xuweishun/Downloads/redex REPO_URL=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo ROOT=/Users/xuweishun/Downloads/redex SDKMAN_CANDIDATES_API=https://api.sdkman.io/2 SDKMAN_CANDIDATES_DIR=/Users/xuweishun/.sdkman/candidates SDKMAN_DIR=/Users/xuweishun/.sdkman SDKMAN_PLATFORM=darwinarm64 SHELL=/bin/zsh SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix SHLVL=2 SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.F9Z7sclZss/Listeners TERM=xterm-256color TERM_PROGRAM=vscode TERM_PROGRAM_VERSION=1.91.1 TMPDIR=/var/folders/x3/162n_v0n403fbr_xrsy8q_bw0000gn/T/ TOOLCHAIN_TMP=/var/folders/x3/162n_v0n403fbr_xrsy8q_bw0000gn/T/tmp.oJgqOlmTzo UID=501 USER=admin USER_ZDOTDIR=/Users/xuweishun VSCODE_GIT_ASKPASS_EXTRA_ARGS= VSCODE_GIT_ASKPASS_MAIN='/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js' VSCODE_GIT_ASKPASS_NODE='/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)' VSCODE_GIT_IPC_HANDLE=/var/folders/x3/162n_v0n403fbr_xrsy8q_bw0000gn/T/vscode-git-8a5878708c.sock VSCODE_INJECTION=1 VSCODE_PATH_PREFIX=/Users/xuweishun/Documents/flutter/bin/cache/dart-sdk/bin/: XPC_FLAGS=0x0 XPC_SERVICENAME=0 ZDOTDIR=/Users/xuweishun = _CE_CONDA= _CE_M= CFBundleIdentifier=com.microsoft.VSCode CF_USER_TEXT_ENCODING=0x1F5:0x19:0x34 Unsupported OS -

Xuws2014 commented 1 month ago

ld: warning: -bind_at_load is deprecated on macOS Undefined symbols for architecture arm64: "_rpl_malloc", referenced from: android::ResStringPool::setTo(void const, unsigned long, bool) in libredex.a149 android::ResXMLTree::setTo(void const, unsigned long, bool) in libredex.a149 android::SharedBuffer::alloc(unsigned long) in libredex.a151 android::VectorImpl::sort(int ()(void const, void const)) in libredex.a156 android::VectorImpl::sort(int ()(void const, void const, void), void) in libredex.a156 "_rpl_realloc", referenced from: android::SharedBuffer::editResize(unsigned long) const in libredex.a151 ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)