helloworld icon indicating copy to clipboard operation
helloworld copied to clipboard

arm64编译报错

Open yonggedebaqi opened this issue 2 years ago • 5 comments

~/lede/build_dir/target-aarch64_generic_musl/naiveproxy-113.0.5672.62-2/src ~/lede/package/helloworld/naiveproxy Support Linux AMD64 only. make[3]: *** [Makefile:121: /home/PAUL/lede/build_dir/target-aarch64_generic_musl/naiveproxy-113.0.5672.62-2/.configured_68b329da9893e34099c7d8ad5cb9c940] Error 1 make[3]: Leaving directory '/home/PAUL/lede/package/helloworld/naiveproxy' time: package/helloworld/naiveproxy/compile#3.01#2.55#4.92 ERROR: package/helloworld/naiveproxy failed to build. make[2]: *** [package/Makefile:116: package/helloworld/naiveproxy/compile] Error 1 make[2]: Leaving directory '/home/PAUL/lede' make[1]: *** [package/Makefile:110: /home/PAUL/lede/staging_dir/target-aarch64_generic_musl/stamp/.package_compile] Error 2 make[1]: Leaving directory '/home/PAUL/lede' make: *** [/home/PAUL/lede/include/toplevel.mk:231: world] Error 2

yonggedebaqi avatar Jun 11 '23 11:06 yonggedebaqi

这是我自己修改的Makefile

SPDX-License-Identifier: GPL-3.0-only

Copyright (C) 2021 ImmortalWrt.org

include $(TOPDIR)/rules.mk

PKG_NAME:=naiveproxy PKG_VERSION:=113.0.5672.62-2 PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/klzgrad/naiveproxy/tar.gz/v$(PKG_VERSION)? PKG_HASH:=75db685789d550094343a76fdcbb6ea2bfcb708c3330af621ca532842251fb26

PKG_LICENSE:=BSD 3-Clause PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=Tianling Shen [email protected]

PKG_BUILD_DEPENDS:=gn/host ifneq ($(wildcard $(TOPDIR)/feeds/packages/devel/ninja/ninja.mk),) PKG_BUILD_DEPENDS+= ninja/host endif PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 PKG_BUILD_DEPENDS+= +arm64

ifneq ($(CONFIG_CPU_TYPE)," ") CPU_TYPE:=$(word 1, $(subst +," ,$(CONFIG_CPU_TYPE))) CPU_SUBTYPE:=$(word 2, $(subst +, ",$(CONFIG_CPU_TYPE))) ifeq ($(CPU_SUBTYPE),) CPU_SUBTYPE:="" endif else CPU_TYPE:="" CPU_SUBTYPE:="" endif

include $(INCLUDE_DIR)/package.mk

define Package/naiveproxy SECTION:=net CATEGORY:=Network SUBMENU:=Web Servers/Proxies TITLE:=Make a fortune quietly URL:=https://github.com/klzgrad/naiveproxy DEPENDS:=@!(arc||armeb||mips||mips64||powerpc||TARGET_gemini||arm64) +libatomic endef

define Package/naiveproxy/description NaïveProxy uses Chrome's network stack to camouflage traffic with strong censorship resistance and low detectability. Reusing Chrome's stack also ensures best practices in performance and security. endef

ifneq ($(CONFIG_CCACHE),) export CCACHE_SLOPPINESS=time_macros export CCACHE_BASEDIR=$(PKG_BUILD_DIR)/src export CCACHE_CPP2=yes export naive_ccache_flags=cc_wrapper="$(CCACHE)" endif

CLANG_VER:=17-init-4759-g547e3456-1 CLANG_FILE:=clang-llvmorg-$(CLANG_VER).tgz define Download/CLANG URL:=https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64 URL_FILE:=$(CLANG_FILE) FILE:=$(CLANG_FILE) HASH:=1949427e0030523dc86bdf4b63dac88228cfe05c57318be2d0b0b290297925f6 endef

PGO_VER:=5672-1682419203-4df9c2f8b97b0e23303fa2b15279906232abc306 PGO_FILE:=chrome-linux-$(PGO_VER).profdata define Download/PGO_PROF URL:=https://storage.googleapis.com/chromium-optimization-profiles/pgo_profiles URL_FILE:=$(PGO_FILE) FILE:=$(PGO_FILE) HASH:=5fae812f617d882222cd5aa5620fb355583391127f608759b030c231b71d4c90 endef

define Build/Prepare $(call Build/Prepare/Default)

( \
	pushd $(PKG_BUILD_DIR)/src ; \
	mkdir -p "chrome/build/pgo_profiles" ; \
	$(CP) "$(DL_DIR)/$(PGO_FILE)" "chrome/build/pgo_profiles" ; \
	mkdir -p "third_party/llvm-build/Release+Asserts" ; \
	$(TAR) -xzf "$(DL_DIR)/$(CLANG_FILE)" -C "third_party/llvm-build/Release+Asserts" ; \
	echo -e "llvmorg-$(CLANG_VER)" > "third_party/llvm-build/Release+Asserts/cr_build_revision" ; \
	popd ; \
)

endef

define Build/Configure (
pushd "$(PKG_BUILD_DIR)/src" ;
. ../init_env.sh "$(ARCH)" $(CPU_TYPE) $(CPU_SUBTYPE) "$(TOOLCHAIN_DIR)" ;
export naive_flags+=" $$$${naive_ccache_flags}" ;
mkdir -p "out" ;
gn gen "out/Release" --args="$$$${naive_flags}" --script-executable="$(PYTHON)" ;
popd ;
) endef

define Build/Compile ninja -C "$(PKG_BUILD_DIR)/src/out/Release" naive endef

define Package/naiveproxy/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/out/Release/naive $(1)/usr/bin/naive endef

$(eval $(call Download,CLANG)) $(eval $(call Download,PGO_PROF))

$(eval $(call BuildPackage,naiveproxy))

yonggedebaqi avatar Jun 11 '23 11:06 yonggedebaqi

#!/bin/bash

SPDX-License-Identifier: GPL-3.0-only

Copyright (C) 2021 ImmortalWrt.org

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

Init build dependencies for naiveproxy

Read args from shell

target_arch="$1" cpu_type="$2" cpu_subtype="$3" toolchain_dir="$4"

Set arch info

case "${target_arch}" in "aarch64") naive_arch="aarch64" ;; "i386") naive_arch="x86" ;; "x86_64") naive_arch="x64" ;; *) naive_arch="${target_arch}" ;; esac

OS detection

[ "$(uname)" != "Linux" -o "$(uname -m)" != "aarch64" ] && { echo -e "Support Linux AArch64 only."; exit 1; }

Create TMP dir

mkdir -p "$PWD/tmp" export TMPDIR="$PWD/tmp"

Set ENV

export DEPOT_TOOLS_WIN_TOOLCHAIN=0 export naive_flags=" is_official_build=true exclude_unwind_tables=true enable_resource_allowlist_generation=false symbol_level=1 is_clang=true use_sysroot=false

fatal_linker_warnings=false treat_warnings_as_errors=false

enable_base_tracing=false use_udev=false use_aura=false use_ozone=false use_gio=false use_gtk=false use_platform_icu_alternatives=true use_glib=false

disable_file_support=true enable_websockets=false use_kerberos=false enable_mdns=false enable_reporting=false include_transport_security_state_preload_list=false use_nss_certs=false

target_os="openwrt" target_cpu="${naive_arch}" target_sysroot="${toolchain_dir}""

case "${target_arch}" in "arm") naive_flags+=" arm_version=0 arm_cpu="${cpu_type}"" case "${cpu_type}" in "arm1176jzf-s"|"arm926ej-s"|"mpcore"|"xscale") naive_flags+=" arm_use_thumb=false" ;; esac if [ -n "${cpu_subtype}" ]; then if grep -q "neon" <<< "${cpu_subtype}"; then neon_flag="arm_use_neon=true" else neon_flag="arm_use_neon=false" fi naive_flags+=" arm_fpu="${cpu_subtype}" arm_float_abi="hard" ${neon_flag}" else naive_flags+=" arm_float_abi="soft" arm_use_neon=false" fi ;; "arm64") [ -n "${cpu_type}" ] && naive_flags+=" arm_cpu="${cpu_type}"" ;; "mipsel"|"mips64el") naive_flags+=" use_thin_lto=false chrome_pgo_phase=0 mips_arch_variant="r2"" if [ "${target_arch}" == "mipsel" ]; then if [ "${cpu_subtype}" == "24kf" ]; then naive_flags+=" mips_float_abi="hard"" else naive_flags+=" mips_float_abi="soft"" fi fi ;; esac

yonggedebaqi avatar Jun 11 '23 11:06 yonggedebaqi

最后还是不行Collected errors:

  • pkg_hash_check_unresolved: cannot find dependency naiveproxy for luci-app-ssr-plus
  • pkg_hash_fetch_best_installation_candidate: Packages for luci-app-ssr-plus found, but incompatible with the architectures configured
  • opkg_install_cmd: Cannot install package luci-app-ssr-plus.
  • satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-i18n-ssr-plus-zh-cn:
  •  naiveproxy
    
  • opkg_install_cmd: Cannot install package luci-i18n-ssr-plus-zh-cn.
  • check_data_file_clashes: Package luci-app-docker wants to install file /home/PAUL/lede/build_dir/target-aarch64_generic_musl/root-armvirt/etc/config/dockerd But that file is already provided by package * dockerd
  • check_data_file_clashes: Package luci-app-docker wants to install file /home/PAUL/lede/build_dir/target-aarch64_generic_musl/root-armvirt/etc/docker/daemon.json But that file is already provided by package * dockerd
  • check_data_file_clashes: Package luci-app-docker wants to install file /home/PAUL/lede/build_dir/target-aarch64_generic_musl/root-armvirt/etc/init.d/dockerd But that file is already provided by package * dockerd
  • opkg_install_cmd: Cannot install package luci-app-docker.
  • check_data_file_clashes: Package luci-app-docker wants to install file /home/PAUL/lede/build_dir/target-aarch64_generic_musl/root-armvirt/etc/config/dockerd But that file is already provided by package * dockerd
  • check_data_file_clashes: Package luci-app-docker wants to install file /home/PAUL/lede/build_dir/target-aarch64_generic_musl/root-armvirt/etc/docker/daemon.json But that file is already provided by package * dockerd
  • check_data_file_clashes: Package luci-app-docker wants to install file /home/PAUL/lede/build_dir/target-aarch64_generic_musl/root-armvirt/etc/init.d/dockerd But that file is already provided by package * dockerd
  • opkg_install_cmd: Cannot install package luci-i18n-docker-zh-cn.
  • resolve_conffiles: Existing conffile /home/PAUL/lede/build_dir/target-aarch64_generic_musl/root-armvirt/etc/config/socat is different from the conffile in the new package. The new conffile will be placed at /home/PAUL/lede/build_dir/target-aarch64_generic_musl/root-armvirt/etc/config/socat-opkg. make[2]: *** [package/Makefile:70: package/install] Error 255 make[2]: Leaving directory '/home/PAUL/lede' make[1]: *** [package/Makefile:111: /home/PAUL/lede/staging_dir/target-aarch64_generic_musl/stamp/.package_install] Error 2 make[1]: Leaving directory '/home/PAUL/lede' make: *** [/home/PAUL/lede/include/toplevel.mk:231: world] Error 2

yonggedebaqi avatar Jun 11 '23 12:06 yonggedebaqi

rm -rf bin

coolsnowwolf avatar Jun 17 '23 19:06 coolsnowwolf

删除了,没有还是报错

yonggedebaqi avatar Jun 22 '23 03:06 yonggedebaqi