精华内容
下载资源
问答
  • mac上编译 arm linux gnueabi交叉编译工具链toolchain crosstool-ng 编译和安装 交叉编译工具下载: git clone git@github.com:secularbird/crosstool-ng.git 切换到mac编译分支 ...

    crosstool-ng 编译和安装

    交叉编译工具下载:

    git clone git@github.com:secularbird/crosstool-ng.git
     
    切换到mac编译分支
    git checkout origin/macporting -b macporting
    该分支对编译中出现的一些编译error,进行了修正,并对mulitlib的编译进行了一定程度的修正
     
    编译和安装
    cd crosstool-ng
    指定安装路径(默认安装在/usr/local下).,和mac下的一些ports工具,如gobjcopy,这些可以通过mac-ports 安装
    ./bootstrap 
    ./configure --prefix=${install_path} --with-objcopy=/opt/local/bin/gobjcopy --with-objdump=/opt/local/bin/gobjdump --with-libtool=/opt/local/bin/glibtool --with-readelf=/opt/local/bin/greadelf --witibtoolize=/opt/local/bin/glibtoolize 
    make
    make install
     
    使用crosstool-ng编译arm工具链
    ct-ng menuconfig
    由于mac有些限制,有些地方需要特别设定下
    具体步骤如下:
    make version 3.82在编译glibc时有问题,打开EXPERIMENTAL feature以便使用自带的make
    Paths and misc options  ---> [*] Try features marked as EXPERIMENTAL
      
    打开debug功能,以便可以进行单个step的编译,而不是每次都重新编译所有的
    Paths and misc options  ---> [*] Debug crosstool-NG 
                                                 ---> Debug crosstool-NG  
                                                         ---> gzip saved states (NEW)
    Paths and misc options  ---> Maximum log level to see: (INFO) 
     
    根据自己的需要定制cpu
    Target options  --->   Target Architecture (arm)
    Target options  --->   (armv6k) Architecture level
    Target options  --->   (arm1176jzf-s) Tune for CPU
    Target options  --->   (vfp) Use specific FPU
     
    Operating System  --->  Target OS (linux) 
    Operating System  --->  Linux kernel version (2.6.32.60 (longterm))
     
    C compiler  ---> C compiler (gcc) 
    C compiler  ---> [*] Show Linaro versions
    C compiler  ---> gcc version (linaro-4.6-2013.04)
    C compiler  ---> [*] C++
    apple gcc不支持静态链接,关闭静态链接
    C compiler  ---> [ ] Link libstdc++ statically into the gcc binary
     
    这里使用glibc 2.13
    C-library  --->  C library (glib) 
    C-library  --->  glibc version (2.13)
     
    使用4.3.2的GMP,5.0+的存在编译问题
    Companion libraries  ---> GMP version (4.3.2)
     
    编译自定义的make,
    Companion tools  --->  [*] Build some companion tools 
    Companion tools  --->  [*]   make
     
    Esc Esc 保存并退出设定界面
     
    编译工具链
    ct-ng build
     
     
    编译完成后,工具链默认存放在在~/x-tools/下
     
     
     
     
     
     
     
     
     
     
    posted on 2013-06-29 23:47 secularbird 阅读( ...) 评论( ...) 编辑 收藏

    转载于:https://www.cnblogs.com/zelos/p/3163205.html

    展开全文
  • 使用crosstool-ng制作的MacOSarm-linux交叉编译器,编译器版本linaro 7.2.1,支持armv8,cortex-a53,neon-vfpv4。可以在Mac下开发树莓派3程序。MacOS下需要安装到区分大小写的分区中,具体方法网上找。
  • 树莓派的交叉编译工具链,适用于安装在x86的64位ubuntu系统上,用于编译arm平台树莓派上可运行的程序 文件名:gcc-linaro-arm-linux-gnueabihf-raspbian-x64.zip
  • 在嵌入式开发过程中,设备的存储空间和运算能力通常会比较低,这时候,比如要编译一个linux的内核,嵌入式设备就不能胜任了,所以,实现交叉编译还是很必要的。通过交叉编译,我们就能够在我们的pc上编译出能够在...

    在嵌入式开发过程中,设备的存储空间和运算能力通常会比较低,这时候,比如要编译一个linux的内核,嵌入式设备就不能胜任了,所以,实现交叉编译还是很必要的。通过交叉编译,我们就能够在我们的pc上编译出能够在嵌入式设备上使用的可执行程序。

    下面,我将一步步讲解如何在MAC OS上实现树莓派(arm)的交叉编译。

    一。新建一个磁盘映像

    MAC OS的文件系统默认是大小写不敏感的,而交叉编译工具链是基于大小写敏感的文件系统的,所以我们不能直接把工具链安装在原来的文件系统中,而是需要新建一个大小写敏感的磁盘印象用于安装工具链。

    实现这一功能并不难,使用系统自带的磁盘工具(disk utility

    )就可以实现了。打开磁盘工具,然后 文件>新建>空白磁盘映像,然后在弹出窗口中设置名称为arm-x(便于后续操作),大小至少为500M,格式为Mac OS扩展(区分大小写,日志式)的映像(如下图)。

    a65601f65eaa

    a65601f65eaa

    二。下载已经编译完的工具链

    从下面的链接下载已经编译完的arm GNU Linux 工具链:

    如果你想自己一步步编译,了解工具链中的具体元素的话,可以看一下下面这篇文档:

    三。解压工具链压缩包到磁盘映像

    在终端进入压缩包所在的目录,执行下面的指令即可:

    (新建的磁盘映像默认是挂载的,如果没有挂载的话请先手动挂载)

    tar -zx -C /Volumes/arm-x/ --strip-components 1 -f ARMx-2009q3-67.tar.bz2

    四。使用工具链

    现在已经能够直接使用工具链了,比如我写了一个hello.c程序,现在可以直接使用工具链对程序进行编译。

    在终端执行:

    a65601f65eaa

    /Volumes/arm-x/bin/arm-none-linux-gnueabi-gcc hello.c -o hello

    就可以获得一个名为hello的可执行程序。这个程序在mac下是不能运行的,需要在arm处理器的设备上才能运行。

    当然,如果你嫌输入一大串路径去调用arm-none-linux-gnueabi-gcc程序麻烦的话,可以把/Volumes/arm-x/bin目录添加到PATH里去,这样就能够像使用系统命令一样使用了。(添加环境变量的方法很多,建议把路径添加到~/.profile文件中去,具体操作百度一下你就知道)

    五。把hello程序上传到树莓派上

    如果你自己知道怎么把文件上传到树莓派上,那么请直接上传吧。如果不会,我在这里提供两种方法:

    1.使用sftp:这种方法无需另外设置,可以直接把文件上传到树莓派,但每一次更改都需要重新上传。

    步骤:

    sftp pi@192.168.1.5 (ip地址根据你的地址进行更改)

    然后输入密码raspberry

    put /本地文件路径    /上传到树莓派上的目录

    (例如:put /Users/icool/Desktop/hello . )

    2.使用NFS:这种方法需要先进行配置,但配置好后使用十分方便。可以将树莓派上的文件直接映射到mac上,这样在mac上修改即可,无需再上传。

    具体步骤可以参考这篇文档:

    六。在树莓派上执行上传的程序

    ssh连接上树莓派(或者任意方法,登陆上树莓派即可)。

    然后进入hello程序所在目录,执行:

    ./hello

    结果如下:

    七。测试浮点程序

    通过上一步可以发现交叉编译得到的hello,world程序可以在树莓派上正常运行,下面要检验一下浮点程序是否也可以正常运行。

    先写一个简单的浮点程序:

    检验结果:

    展开全文
  • 换句话说,在 Mac 上为 ARM/Linux 编译代码。 基于和 ,工具链目前以一种变体形式提供,即 ,如果有兴趣,将来可能会支持和 。 工具链是使用构建系统构建的。 下载 工具链 海湾合作委员会 广交会 Linux 头文件 ...
  • MacOS编译OpenJDK12编译环境编译准备OpenJDK12源码下载安装JDK11安装Xcode安装command line tools安装Homebrew安装依赖库 编译环境 MacOS Catalina 10.15.4 Xcode 11.5 command line tools Homebrew 2.2.5 编译...

    编译环境

    • MacOS Catalina 10.15.4
    • Xcode 11.5
    • command line tools
    • Homebrew 2.2.5

    编译准备

    OpenJDK12源码下载

    浏览器打开地址:https://hg.openjdk.java.net/jdk/jdk12/

    点击左侧Browse,将显示源码根目录页面:
    在这里插入图片描述
    点击左侧bz2、zip、gz 中任意一个,即可下载压缩好的源码包。
    在这里插入图片描述
    如果下载较慢或者下载失败,可使用百度网盘下载。建议从官网下载,可以获取最新源码。
    链接: OpenJDK12源码
    提取密码: sbcf

    安装JDK11

    由于JDK源码中大部分代码还是采用JAVA语言实现,所以在编译前需要准备好另一个编译期可用的JDK,官方称此JDK为Bootstrap JDK。假设需要编译的JDK大版本号为N,我们必须准备好另外一个大版本号至少为N-1的JDK。

    安装Xcode

    App Store安装
    在这里插入图片描述

    安装command line tools

    从App Store上下载的Xcode,默认是不会安装Command Line Tools的,Command Line Tools是在Xcode中的一款工具,可以在命令行中运行C程序。

    打开终端,在终端中输入命令

    xcode-select --install 
    

    安装完成后,在终端中执行 gcc -v 命令查看是否安装成功。
    如果显示如下内容,则安装成功。

    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
    Apple clang version 11.0.3 (clang-1103.0.32.62)
    Target: x86_64-apple-darwin19.4.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    

    安装Homebrew

    进入Homebrew官网获取最新下载链接;
    在这里插入图片描述
    打开终端,运行拷贝的命令:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    

    执行过程中会要求输入密码,输入密码回车继续安装;

    安装完成后,会出现 Installation successful! 字样,即安装成功。

    终端运行如下命令,可查看安装的版本信息:

    brew -v
    

    输出示例:

    Homebrew 2.2.5
    Homebrew/homebrew-core (git revision e6c5f; last commit 2020-02-09)
    

    安装依赖库

    打开终端,执行如下命令:

    brew install ccache
    brew install freetype
    brew install autoconf
    

    编译JDK

    编译参数

    编译参数可通过在JDK源码目录下执行以下命令查询:

    bash  configure --help
    

    查询结果示例如下:

    `configure' configures OpenJDK openjdk to adapt to many kinds of systems.
    
    Usage: /Users/fcc/Project/JDKSource/jdk12-06222165c35f/configure [OPTION]... [VAR=VALUE]...
    
    To assign environment variables (e.g., CC, CFLAGS...), specify them as
    VAR=VALUE.  See below for descriptions of some of the useful variables.
    
    Defaults for the options are specified in brackets.
    
    Configuration:
      -h, --help              display this help and exit
          --help=short        display options specific to this package
          --help=recursive    display the short help of all the included packages
      -V, --version           display version information and exit
      -q, --quiet, --silent   do not print `checking ...' messages
          --cache-file=FILE   cache test results in FILE [disabled]
      -C, --config-cache      alias for `--cache-file=config.cache'
      -n, --no-create         do not create output files
          --srcdir=DIR        find the sources in DIR [configure dir or `..']
    
    Installation directories:
      --prefix=PREFIX         install architecture-independent files in PREFIX
                              [/usr/local]
      --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                              [PREFIX]
    
    By default, `make install' will install all the files in
    `/usr/local/bin', `/usr/local/lib' etc.  You can specify
    an installation prefix other than `/usr/local' using `--prefix',
    for instance `--prefix=$HOME'.
    
    For better control, use the options below.
    
    Fine tuning of the installation directories:
      --bindir=DIR            user executables [EPREFIX/bin]
      --sbindir=DIR           system admin executables [EPREFIX/sbin]
      --libexecdir=DIR        program executables [EPREFIX/libexec]
      --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
      --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
      --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
      --libdir=DIR            object code libraries [EPREFIX/lib]
      --includedir=DIR        C header files [PREFIX/include]
      --oldincludedir=DIR     C header files for non-gcc [/usr/include]
      --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
      --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
      --infodir=DIR           info documentation [DATAROOTDIR/info]
      --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
      --mandir=DIR            man documentation [DATAROOTDIR/man]
      --docdir=DIR            documentation root [DATAROOTDIR/doc/openjdk]
      --htmldir=DIR           html documentation [DOCDIR]
      --dvidir=DIR            dvi documentation [DOCDIR]
      --pdfdir=DIR            pdf documentation [DOCDIR]
      --psdir=DIR             ps documentation [DOCDIR]
    
    X features:
      --x-includes=DIR    X include files are in DIR
      --x-libraries=DIR   X library files are in DIR
    
    System types:
      --build=BUILD     configure for building on BUILD [guessed]
      --host=HOST       cross-compile to build programs to run on HOST [BUILD]
      --target=TARGET   configure for building compilers for TARGET [HOST]
    
    Optional Features:
      --disable-option-checking  ignore unrecognized --enable/--with options
      --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
      --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
      --enable-openjdk-only   suppress building custom source even if present
                              [disabled]
      --enable-debug          set the debug level to fastdebug (shorthand for
                              --with-debug-level=fastdebug) [disabled]
      --enable-headless-only  only build headless (no GUI) support [disabled]
      --enable-full-docs      build complete documentation [enabled if all tools
                              found]
      --disable-unlimited-crypto
                              Disable unlimited crypto policy [enabled]
      --disable-keep-packaged-modules
                              Do not keep packaged modules in jdk image [enable]
      --enable-static-build   enable static library build [disabled]
      --disable-warnings-as-errors
                              do not consider native warnings to be an error
                              [enabled]
      --enable-native-coverage
                              enable native compilation with code coverage
                              data[disabled]
      --enable-asan           enable AddressSanitizer if possible [disabled]
      --enable-dtrace[=yes/no/auto]
                              enable dtrace. Default is auto, where dtrace is
                              enabled if all dependencies are present.
      --enable-aot[=yes/no/auto]
                              enable ahead of time compilation feature. Default is
                              auto, where aot is enabled if all dependencies are
                              present.
      --enable-cds[=yes/no/auto]
                              enable class data sharing feature in non-minimal VM.
                              Default is auto, where cds is enabled if supported
                              on the platform.
      --disable-hotspot-gtest Disables building of the Hotspot unit tests
                              [enabled]
      --enable-libffi-bundling
                              enable bundling of libffi.so to make the built JDK
                              runnable on more systems
      --enable-jtreg-failure-handler
                              forces build of the jtreg failure handler to be
                              enabled, missing dependencies become fatal errors.
                              Default is auto, where the failure handler is built
                              if all dependencies are present and otherwise just
                              disabled.
      --disable-generate-classlist
                              forces enabling or disabling of the generation of a
                              CDS classlist at build time. Default is to generate
                              it when either the server or client JVMs are built
                              and enable-cds is true.
      --disable-manpages      Set to disable copy of static man pages [enabled]
      --disable-cds-archive   Set to disable generation of a default CDS archive
                              in the product image [enabled]
      --enable-sjavac         use sjavac to do fast incremental compiles
                              [disabled]
      --disable-javac-server  disable javac server [enabled]
      --enable-icecc          enable distribted compilation of native code using
                              icecc/icecream [disabled]
      --disable-precompiled-headers
                              disable using precompiled headers when compiling C++
                              [enabled]
      --enable-ccache         enable using ccache to speed up recompilations
                              [disabled]
    
    Optional Packages:
      --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
      --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
      --with-target-bits      build 32-bit or 64-bit binaries (for platforms that
                              support it), e.g. --with-target-bits=32 [guessed]
      --with-debug-level      set the debug level (release, fastdebug, slowdebug,
                              optimized) [release]
      --with-jvm-variants     JVM variants (separated by commas) to build
                              (server,client,minimal,core,zero,custom) [server]
      --with-devkit           use this devkit for compilers, tools and resources
      --with-sys-root         alias for --with-sysroot for backwards compatability
      --with-sysroot          use this directory as sysroot
      --with-tools-dir        alias for --with-toolchain-path for backwards
                              compatibility
      --with-toolchain-path   prepend these directories when searching for
                              toolchain binaries (compilers etc)
      --with-extra-path       prepend these directories to the default path
      --with-sdk-name         use the platform SDK of the given name. [macosx]
      --with-conf-name        use this as the name of the configuration [generated
                              from important configuration options]
      --with-output-sync      set make output sync type if supported by make.
                              [recurse]
      --with-default-make-target
                              set the default make target [exploded-image]
      --with-log              [default vaue for make LOG argument [warn]]
      --with-cacerts-file     specify alternative cacerts file
      --with-copyright-year   Set copyright year value for build [current year]
      --with-jni-libpath      override default JNI library search path
      --with-vendor-name      Set vendor name. Among others, used to set the
                              'java.vendor' and 'java.vm.vendor' system
                              properties. [not specified]
      --with-vendor-url       Set the 'java.vendor.url' system property [not
                              specified]
      --with-vendor-bug-url   Set the 'java.vendor.url.bug' system property [not
                              specified]
      --with-vendor-vm-bug-url
                              Sets the bug URL which will be displayed when the VM
                              crashes [not specified]
      --with-version-string   Set version string [calculated]
      --with-version-pre      Set the base part of the version 'PRE' field
                              (pre-release identifier) ['internal']
      --with-version-opt      Set version 'OPT' field (build metadata)
                              [<timestamp>.<user>.<dirname>]
      --with-version-build    Set version 'BUILD' field (build number) [not
                              specified]
      --with-version-feature  Set version 'FEATURE' field (first number) [current
                              source value]
      --with-version-interim  Set version 'INTERIM' field (second number) [current
                              source value]
      --with-version-update   Set version 'UPDATE' field (third number) [current
                              source value]
      --with-version-patch    Set version 'PATCH' field (fourth number) [not
                              specified]
      --with-version-extra1   Set 1st version extra number [not specified]
      --with-version-extra2   Set 2nd version extra number [not specified]
      --with-version-extra3   Set 3rd version extra number [not specified]
      --with-version-date     Set version date [current source value]
      --with-vendor-version-string
                              Set vendor version string [not specified]
      --with-boot-jdk         path to Boot JDK (used to bootstrap build) [probed]
      --with-boot-jdk-jvmargs specify additional arguments to be passed to Boot
                              JDK tools [none]
      --with-build-jdk        path to JDK of same version as is being built[the
                              newly built JDK]
      --with-import-modules   import a set of prebuilt modules either as a zip
                              file or an exploded directory
      --with-toolchain-type   the toolchain type (or family) to use, use '--help'
                              to show possible values [platform dependent]
      --with-extra-cflags     extra flags to be used when compiling jdk c-files
      --with-extra-cxxflags   extra flags to be used when compiling jdk c++-files
      --with-extra-ldflags    extra flags to be used when linking jdk
      --with-toolchain-version
                              the version of the toolchain to look for, use
                              '--help' to show possible values [platform
                              dependent]
      --with-build-devkit     Devkit to use for the build platform toolchain
      --with-jtreg            Regression Test Harness [probed]
      --with-jmh              Java Microbenchmark Harness for building the OpenJDK
                              Microbenchmark Suite
      --with-jib              Jib dependency management tool [not used]
      --with-macosx-version-max
                              error on use of newer functionality. [macosx]
      --with-abi-profile      specify ABI profile for ARM builds
                              (arm-vfp-sflt,arm-vfp-hflt,arm-sflt,
                              armv5-vfp-sflt,armv6-vfp-hflt,aarch64) [toolchain
                              dependent]
      --with-native-debug-symbols
                              set the native debug symbol configuration (none,
                              internal, external, zipped) [varying]
      --with-jcov             jcov library location
      --with-jcov-input-jdk   jdk image to instrument
      --with-stdc++lib=<static>,<dynamic>,<default>
                              force linking of the C++ runtime on Linux to either
                              static or dynamic, default is static with dynamic as
                              fallback
      --with-msvcr-dll        path to microsoft C runtime dll (msvcr*.dll)
                              (Windows only) [probed]
      --with-msvcp-dll        path to microsoft C++ runtime dll (msvcp*.dll)
                              (Windows only) [probed]
      --with-ucrt-dll-dir     path to Microsoft Windows Kit UCRT DLL dir (Windows
                              only) [probed]
      --with-x                use the X Window System
      --with-cups             specify prefix directory for the cups package
                              (expecting the headers under PATH/include)
      --with-cups-include     specify directory for the cups include files
      --with-fontconfig       specify prefix directory for the fontconfig package
                              (expecting the headers under PATH/include)
      --with-fontconfig-include
                              specify directory for the fontconfig include files
      --with-freetype         specify whether to use 'system' or 'bundled'
                              freetype. Other values are errors. The selected
                              option applies to both build time and run time. The
                              default behaviour can be platform dependent. If
                              using 'system' and either the include files or
                              libraries cannot be located automatically, then
                              additionally specify both using
                              --with-freetype-include and --with-freetype-lib.
      --with-freetype-include specify directory for the freetype include files
      --with-freetype-lib     specify directory for the freetype library
      --with-alsa             specify prefix directory for the alsa package
                              (expecting the libraries under PATH/lib and the
                              headers under PATH/include)
      --with-alsa-include     specify directory for the alsa include files
      --with-alsa-lib         specify directory for the alsa library
      --with-libffi           specify prefix directory for the libffi package
                              (expecting the libraries under PATH/lib and the
                              headers under PATH/include)
      --with-libffi-include   specify directory for the libffi include files
      --with-libffi-lib       specify directory for the libffi library
      --with-libjpeg          use libjpeg from build system or OpenJDK source
                              (system, bundled) [bundled]
      --with-giflib           use giflib from build system or OpenJDK source
                              (system, bundled) [bundled]
      --with-libpng           use libpng from build system or OpenJDK source
                              (system, bundled) [bundled]
      --with-zlib             use zlib from build system or OpenJDK source
                              (system, bundled) [bundled]
      --with-lcms             use lcms2 from build system or OpenJDK source
                              (system, bundled) [bundled]
      --with-graalunit-lib    specify location of 3rd party libraries used by
                              Graal unit tests
      --with-jvm-features     JVM features to enable (foo) or disable (-foo),
                              separated by comma. Use '--help' to show possible
                              values [none]
      --with-with-cpu-port    Deprecated. Option is kept for backwards
                              compatibility and is ignored
      --with-exclude-translations
                              a comma separated list of locales to exclude
                              translations for. Default is to include all
                              translations present in the source.
      --with-num-cores        number of cores in the build system, e.g.
                              --with-num-cores=8 [probed]
      --with-memory-size      memory (in MB) available in the build system, e.g.
                              --with-memory-size=1024 [probed]
      --with-jobs             number of parallel jobs to let make run [calculated
                              based on cores and memory]
      --with-test-jobs        number of parallel tests jobs to run [based on build
                              jobs]
      --with-sjavac-server-java
                              use this java binary for running the sjavac
                              background server [Boot JDK java]
      --with-ccache-dir       where to store ccache files [~/.ccache]
    
    Some influential environment variables:
      BASENAME    Override default value for BASENAME
      BASH        Override default value for BASH
      CAT         Override default value for CAT
      CHMOD       Override default value for CHMOD
      CMP         Override default value for CMP
      COMM        Override default value for COMM
      CP          Override default value for CP
      CUT         Override default value for CUT
      DATE        Override default value for DATE
      DIFF        Override default value for DIFF
      DIRNAME     Override default value for DIRNAME
      ECHO        Override default value for ECHO
      EXPR        Override default value for EXPR
      FILE        Override default value for FILE
      FIND        Override default value for FIND
      HEAD        Override default value for HEAD
      GUNZIP      Override default value for GUNZIP
      GZIP        Override default value for GZIP
      LN          Override default value for LN
      LS          Override default value for LS
      MKDIR       Override default value for MKDIR
      MKTEMP      Override default value for MKTEMP
      MV          Override default value for MV
      NAWK        Override default value for NAWK
      PRINTF      Override default value for PRINTF
      READLINK    Override default value for READLINK
      RM          Override default value for RM
      RMDIR       Override default value for RMDIR
      SH          Override default value for SH
      SORT        Override default value for SORT
      TAIL        Override default value for TAIL
      TAR         Override default value for TAR
      TEE         Override default value for TEE
      TOUCH       Override default value for TOUCH
      TR          Override default value for TR
      UNAME       Override default value for UNAME
      UNIQ        Override default value for UNIQ
      WC          Override default value for WC
      WHICH       Override default value for WHICH
      XARGS       Override default value for XARGS
      AWK         Override default value for AWK
      GREP        Override default value for GREP
      EGREP       Override default value for EGREP
      FGREP       Override default value for FGREP
      SED         Override default value for SED
      CYGPATH     Override default value for CYGPATH
      DF          Override default value for DF
      CPIO        Override default value for CPIO
      NICE        Override default value for NICE
      PANDOC      Override default value for PANDOC
      MAKE        Override default value for MAKE
      UNZIP       Override default value for UNZIP
      ZIPEXE      Override default value for ZIPEXE
      LDD         Override default value for LDD
      READELF     Override default value for READELF
      DOT         Override default value for DOT
      HG          Override default value for HG
      GIT         Override default value for GIT
      STAT        Override default value for STAT
      TIME        Override default value for TIME
      FLOCK       Override default value for FLOCK
      DTRACE      Override default value for DTRACE
      PATCH       Override default value for PATCH
      DSYMUTIL    Override default value for DSYMUTIL
      MIG         Override default value for MIG
      XATTR       Override default value for XATTR
      CODESIGN    Override default value for CODESIGN
      SETFILE     Override default value for SETFILE
      ELFEDIT     Override default value for ELFEDIT
      PKG_CONFIG  path to pkg-config utility
      JAVA        Override default value for JAVA
      JAVAC       Override default value for JAVAC
      JAVADOC     Override default value for JAVADOC
      JAR         Override default value for JAR
      JARSIGNER   Override default value for JARSIGNER
      CC          C compiler command
      CFLAGS      C compiler flags
      LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
                  nonstandard directory <lib dir>
      LIBS        libraries to pass to the linker, e.g. -l<library>
      CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
                  you have headers in a nonstandard directory <include dir>
      CXX         C++ compiler command
      CXXFLAGS    C++ compiler flags
      CPP         C preprocessor
      CXXCPP      C++ preprocessor
      AS          Override default value for AS
      AR          Override default value for AR
      LIPO        Override default value for LIPO
      OTOOL       Override default value for OTOOL
      INSTALL_NAME_TOOL
                  Override default value for INSTALL_NAME_TOOL
      STRIP       Override default value for STRIP
      NM          Override default value for NM
      GNM         Override default value for GNM
      OBJCOPY     Override default value for OBJCOPY
      OBJDUMP     Override default value for OBJDUMP
      CXXFILT     Override default value for CXXFILT
      BUILD_CC    Override default value for BUILD_CC
      BUILD_CXX   Override default value for BUILD_CXX
      BUILD_NM    Override default value for BUILD_NM
      BUILD_AR    Override default value for BUILD_AR
      BUILD_OBJCOPY
                  Override default value for BUILD_OBJCOPY
      BUILD_STRIP Override default value for BUILD_STRIP
      JTREGEXE    Override default value for JTREGEXE
      XMKMF       Path to xmkmf, Makefile generator for X Window System
      FREETYPE_CFLAGS
                  C compiler flags for FREETYPE, overriding pkg-config
      FREETYPE_LIBS
                  linker flags for FREETYPE, overriding pkg-config
      ALSA_CFLAGS C compiler flags for ALSA, overriding pkg-config
      ALSA_LIBS   linker flags for ALSA, overriding pkg-config
      LIBFFI_CFLAGS
                  C compiler flags for LIBFFI, overriding pkg-config
      LIBFFI_LIBS linker flags for LIBFFI, overriding pkg-config
      PNG_CFLAGS  C compiler flags for PNG, overriding pkg-config
      PNG_LIBS    linker flags for PNG, overriding pkg-config
      LCMS_CFLAGS C compiler flags for LCMS, overriding pkg-config
      LCMS_LIBS   linker flags for LCMS, overriding pkg-config
      ICECC_CMD   Override default value for ICECC_CMD
      ICECC_CREATE_ENV
                  Override default value for ICECC_CREATE_ENV
      ICECC_WRAPPER
                  Override default value for ICECC_WRAPPER
      CCACHE      Override default value for CCACHE
    
    Use these variables to override the choices made by `configure' or to help
    it to find libraries and programs with nonstandard names/locations.
    
    Report bugs to <build-dev@openjdk.java.net>.
    OpenJDK home page: <http://openjdk.java.net>.
    
    Additional (non-autoconf) OpenJDK Options:
      --openjdk-target=TARGET cross-compile with TARGET as target platform
                              (i.e. the one you will run the resulting binary on).
                              Equivalent to --host=TARGET --target=TARGET
                              --build=<current platform>
      --debug-configure       Run the configure script with additional debug
                              logging enabled.
    
    The following toolchains are available as arguments to --with-toolchain-type.
    Which are valid to use depends on the build platform.
      gcc         GNU Compiler Collection
      clang       clang/LLVM
      solstudio   Oracle Solaris Studio
      xlc         IBM XL C/C++
      microsoft   Microsoft Visual Studio
    
    The following JVM features are available as arguments to --with-jvm-features.
    Which are valid to use depends on the target platform.
      compiler1 compiler2 zero minimal dtrace jvmti jvmci graal vm-structs jni-check services management cmsgc epsilongc g1gc parallelgc serialgc shenandoahgc zgc nmt cds static-build link-time-opt aot jfr 
    
    Please be aware that, when cross-compiling, the OpenJDK configure script will
    generally use 'target' where autoconf traditionally uses 'host'.
    
    Also note that variables must be passed on the command line. Variables in the
    environment will generally be ignored, unlike traditional autoconf scripts.
    
    • --with-debug-level=<lecel>:设置编译的级别,可选值为release、fastdebug、slowdebug、越往后进行的优化措施就越少,带的调试信息就越多。默认值为release。--enable-debug:等效与--with-debug-level=fastdebug
    • --with-jvm-variants=[<variant>]:编译特定模式(Variants)的HotSpot虚拟机,可以多个模式并存,可选值有server、client、minimal、core、zero、custom、。

    执行编译

    如编译FastDebug版、仅含Server模式 的HorSpot虚拟机,步骤如下:

    执行如下命令,对编译过程中的依赖项、参数、输出目录进行检查和构建,如果编译过程中需要的工具链或者依赖项有缺失,根据命令行提示进行安装。

    bash configure --enable-debug --with-jvm-variants=server
    

    如果环境一切正常,会提示如下信息:

    Configuration summary:
    * Debug level:    fastdebug
    * HS debug level: fastdebug
    * JVM variants:   server
    * JVM features:   server: 'aot cds cmsgc compiler1 compiler2 dtrace epsilongc g1gc graal jfr jni-check jvmci jvmti management nmt parallelgc serialgc services shenandoahgc vm-structs' 
    * OpenJDK target: OS: macosx, CPU architecture: x86, address length: 64
    * Version string: 12-internal+0-adhoc.fcc.jdk12-06222165c35f (12-internal)
    
    Tools summary:
    * Boot JDK:       java version "12.0.2" 2019-07-16 Java(TM) SE Runtime Environment (build 12.0.2+10) Java HotSpot(TM) 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)  (at /Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home)
    * Toolchain:      clang (clang/LLVM from Xcode 11.5)
    * C Compiler:     Version 11.0.3 (at /usr/bin/clang)
    * C++ Compiler:   Version 11.0.3 (at /usr/bin/clang++)
    
    Build performance summary:
    * Cores to use:   12
    * Memory limit:   16384 MB
    

    操作成功之后,执行编译命令:

    make images
    

    注 意 : 上 述 步 骤 如 果 出 现 异 常 或 者 后 , 再 次 执 行 前 需 要 先 执 行 命 令 清 理 . / b u l i d 编 译 目 录 : \color{red}{注意:上述步骤如果出现异常或者后,再次执行前需要先执行命令清理./bulid编译目录:} ./bulid

    make clean
    
    make dist-clean
    

    正常编译完成后,可在命令行看到成功命令输出:

    Finished building target 'images' in configuration 'macosx-x86_64-server-fastdebug'
    

    至此,OpenJDK12编译完成。

    查看JDK信息

    命令行移动当前位置至jdk12-06222165c35f/build/macosx-x86_64-server-fastdebug/jdk目录下,执行./bin/java -version,可查询编译的JDK版本信息。此目录可打包直接作为完整的JDK进行使用。

    openjdk version "12-internal" 2019-03-19
    OpenJDK Runtime Environment (fastdebug build 12-internal+0-adhoc.fcc.jdk12-06222165c35f)
    OpenJDK 64-Bit Server VM (fastdebug build 12-internal+0-adhoc.fcc.jdk12-06222165c35f, mixed mode)
    

    编译失败问题

    在笔者编译的过程中,出现过如下的错误:

    ERROR: Build failed for target 'images' in configuration 'macosx-x86_64-client-fastdebug' (exit code 2) 
    Stopping sjavac server
    
    === Output from failing command(s) repeated here ===
    * For target hotspot_variant-client_libjvm_gtest_objs_test_symbolTable.o:
    /Users/fcc/Project/JDKSource/jdk12-06222165c35f/test/hotspot/gtest/classfile/test_symbolTable.cpp:62:6: error: explicitly assigning value of variable of type 'TempNewSymbol' to itself [-Werror,-Wself-assign-overloaded]
      s1 = s1; // self assignment
      ~~ ^ ~~
    1 error generated.
    
    * All command lines available in /Users/fcc/Project/JDKSource/jdk12-06222165c35f/build/macosx-x86_64-client-fastdebug/make-support/failure-logs.
    === End of repeated output ===
    
    No indication of failed target found.
    Hint: Try searching the build log for '] Error'.
    Hint: See doc/building.html#troubleshooting for assistance.
    
    make[1]: *** [main] Error 2
    make: *** [images] Error 2
    

    根据日志提示找到了dk12-06222165c35f/test/hotspot/gtest/classfile目录下的test_symbolTable.cpp 文件,跳转第62行,内容如下:
    在这里插入图片描述
    此行我直接将其注释掉了。
    在这里插入图片描述
    保存之后执行清理命令,重新编译。

    展开全文
  • Linux编译WebView应用

    2020-02-15 02:51:14
    之前用Python封装版的pywebview搞过Windows下的exe编译,好球麻烦,打包出来的文件还贼大,闲来无事试试在Linux桌面环境下编译原始C语言版本的WebView应用,没想到居然还真成功了.已经十来年没碰过的C语言,不禁回忆起...

    之前用Python封装版的pywebview搞过Windows下的exe编译,好球麻烦,打包出来的文件还贼大,闲来无事试试在Linux桌面环境下编译原始C语言版本的WebView应用,没想到居然还真成功了.已经十来年没碰过的C语言,不禁回忆起当年被谭浩强所支配的恐惧…

    环境介绍

    最简单的演示

    根据作者github上的入门文档,先把项目clone或下载zip拿过来,找到里面webview.h这个文件,放到项目文件夹中,然后再新建个main.c文件,代码撸成这样:

    // main.c
    #define WEBVIEW_IMPLEMENTATION
    //don't forget to define WEBVIEW_WINAPI,WEBVIEW_GTK or WEBVIEW_COCAO
    #include "webview.h"
    
    #ifdef WIN32
    int WINAPI WinMain(HINSTANCE hInt, HINSTANCE hPrevInst, LPSTR lpCmdLine,
                       int nCmdShow) {
    #else
    int main() {
    #endif
      /* 用800x600可调整大小的窗体打开我的博客 */
      webview("WebView练手演示",
    	  "http://lpwmm.blog.csdn.net", 800, 600, 1);
      return 0;
    }
    

    代码好像也挺简单的哈~关键就是下面的编译了

    编译成可执行文件

    官方文档中是这么介绍的;

    Linux

    $ gcc main.c -DWEBVIEW_GTK=1 pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0 -o webview-example

    MacOS

    $ gcc main.c -DWEBVIEW_COCOA=1 -framework WebKit -o webview-example

    Windows (mingw)

    $ cc main.c -DWEBVIEW_WINAPI=1 -lole32 -lcomctl32 -loleaut32 -luuid -mwindows -o webview-example.exe

    Windows (cl)

    $ cl main.c /D WEBVIEW_WINAPI=1 /link ole32.lib comctl32.lib oleaut32.lib uuid.lib gdi32.lib advapi32.lib

    实际情况是这样的:

    (base) lpwm@lpwm-PC:~/Desktop/webview$ gcc main.c -DWEBVIEW_GTK=1 `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0` -o webview-example
    Package gtk+-3.0 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `gtk+-3.0.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'gtk+-3.0' found
    Package webkit2gtk-4.0 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `webkit2gtk-4.0.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'webkit2gtk-4.0' found
    In file included from main.c:4:0:
    webview.h:42:39: fatal error: JavaScriptCore/JavaScript.h: 没有那个文件或目录
     #include <JavaScriptCore/JavaScript.h>
                                           ^
    compilation terminated.
    

    貌似是缺少gtk相关的包导致,用apt search了一下gkt开头的包一大堆也不知道装那个,不过搜索webkit2gtk倒是找到个带-dev的,试试装了下,结果还就可以了.

    (base) lpwm@lpwm-PC:~/Desktop/webview$ sudo apt install -y libwebkit2gtk-4.0-dev
    (base) lpwm@lpwm-PC:~/Desktop/webview$ gcc main.c -DWEBVIEW_GTK=1 `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0` -o webview-example
    (base) lpwm@lpwm-PC:~/Desktop/webview$ ls
    main.c  webview-example  webview.h
    (base) lpwm@lpwm-PC:~/Desktop/webview$ ./webview-example
    

    在这里插入图片描述

    展开全文
  • 在mac下编译libfdk-aac实在太轻松,想不到编译到i386、arm7、arm7s遇到了很多困难, 终于解决了,拿出来分享下,也恶补了一部分编译知识 编译环境*重点 本脚本适用于mac环境下xcode5以上版本 网上找了很多编译...
  • 如何将Rust从macOS交叉编译Linux x86_64-unknown-linux-gnu的示例 背景/最初动机 截至2020年11月,我macOS笔记本电脑上的使用来迭代Kubernetes集群更改,然后再将其应用于生产集群。 其他事情,例如确保对我的...
  • 但是,在用C和C编译了一个简单的hello world测试程序并尝试在目标板(运行Debian Linux的基于ARM9的板)上运行之后,它们立即出现故障.由于目标板的可用工具有限且没有gdb,我对如何进行调试感到有些困惑.我已经使用Linux...
  • 这就要说到linux下的交叉编译了,因为我们要在PC机上编译出可以运行在ARM上的程序,使用gcc编译出的是在PC上运行的程序,所以我们要使用gcc-arm-none-eabi进行交叉编译~2.gcc-arm-none-eabi toolchain 介绍及安装gcc...
  • macOS编译 webrtc android 端代码 文章目录在 macOS编译 webrtc android 端代码1. 前提2. 编译环境3. 操作步骤3.1 替换 llvm-build3.2 替换 Jdk3.3 修改 gn 脚本3.4 编译脚本4 结束 1. 前提 已提前在 ...
  • mac 电脑上交叉编译n2n,目标机arm linux 下载openssl-1.0.2p,并交叉编译openssl,openssl的安装目录/opt/ssh/openssl-1.0.2p/_install git clone https://github.com/meyerd/n2n.git brew install cmake ~/n2n...
  • 一、编译原因 公司项目需要,故编译安卓系统的boost库1.66.0。最开始考虑到原有boost版本,采用NDK16b中gcc编译器先后编译了armv7、armv8a架构下的boost。但在随后的Android Studio界面开发中,编译的boost库在...
  • 有些开发的朋友习惯使用macos来工作,所以需要在macos编译webrtc android版本, 但是根据webrtc官方的说法,目前...这里说的方法不是使用linux虚拟机,是真的在macos编译。 下面讲解一下如果操作。 ##准备阶段 ...
  • 1、先下载openssl源码... 2、解压缩后进入源码目录执行 ./Configure linux-armv4 no-asm shared --prefix=/Volumes/work/opt/openssl/ 生成Makefile文件 3、编译源码 make CROSS_C...
  • 1.为什么不是gcc在开发stm32的时候,编译工具链要使用gcc-arm-none-eabi,为什么不是gcc呢?这就要说到linux下的交叉编译了,因为我们要在PC机...
  • MacOS基于树莓派的交叉编译实验

    千次阅读 2017-10-15 14:23:37
    要使用arm-gcc来代替gcc编译,在macOS上还要进行一些配置: 1)新建一个磁盘映像MAC OS的文件系统默认是大小写不敏感的,而交叉编译工具链是基于大小写敏感的文件系统的,所以我们不能直接把工具链安装在原来的文件...
  • 这就要说到linux下的交叉编译了,因为我们要在PC机上编译出可以运行在ARM上的程序,使用gcc编译出的是在PC上运行的程序,所以我们要使用gcc-arm-none-eabi进行交叉编译~2.gcc-arm-none-eabi toolchain 介绍及安装gcc...
  • 1.为什么不是gcc 之前我们花了三篇文章介绍Linux下如何进行C语言编程...这是为了给接下来的Linux下嵌入式开发打好基础,尽快熟悉Linux下c编程,但是在开发stm32的时候,编译工具链要使用gcc-arm-none-eabi,为什么...
  • ARM 架构上的 macOS 操作系统 (Apple Silicon),使用方式通过 GOOS=darwin,GOARCH=arm64; 也就是 Apple 发布的最新的 M1 芯片指令集; 至于之前 iOS 平台上的,则由 darwin/arm64 改名为 ios/arm64; Go 1.16 添加...
  • 那么编译一个“Hello World”到底经历了怎样的过程呢? 从源代码到可执行文件 我们将这个文件命名为hello.c: #include <stdio.h> int main() { printf("Hello World\n"); return 0; } 程序的第...
  • 本文属于《IP摄像头技术纵览》系列文章之一: ...IP摄像头技术纵览(一)—linux 内核编译,USB摄像头设备识别开始正文之前先来认识一下我的开发环境: 系统:ubuntu 10.04 + Linux-2.6.30 开发板:AT91SAM9
  • 在嵌入式开发过程中,设备的存储空间和运算能力通常会比较低,这时候,比如要编译一个linux的内核,嵌入式设备就不能胜任了,所以,实现交叉编译还是很必要的。通过交叉编译,我们就能够在我们的pc上编译出能够在...
  • 说实话这一步操作我是失败的,从...如果编译后终端被关闭了,这个需要再执行一遍编译过程的命令行,具体没有操作过。 在编译源码成功后可以执行下面命令行: em...
  • Linux下开发STM32 使用gcc-arm-none-eabi工具链编译生成bin、hex文件 黄工的嵌入式技术圈•来源:黄工的嵌入式技术圈•作者:黄工的嵌入式技术•2020-02-28 15:08•1559次阅读 0 1.为什么不是gcc 在开发stm32的...
  • GCC的初衷是为GNU操作系统专门编写一款编译器,现已被大多数类Unix操作系统(如Linux、BSD、MacOS X等)采纳为标准的编译器,甚至在微软的Windows上也可以使用GCC。GCC支持多种计算机体系结构芯片,如x86、ARM、MIPS...
  • go1.13.12.linux-arm64.tar.gz

    2020-06-02 16:09:40
    Go(又称Golang)是Google开发的一种静态强类型、编译型...Go于2009年11月正式宣布推出,成为开放源代码项目,支持LinuxmacOS、Windows等操作系统。在2016年,Go被软件评价公司TIOBE 选为“TIOBE 2016 年最佳语言”。
  • Golang 支持交叉编译,在一个平台上生成另一个平台的可执行程序,最近使用了一下,非常好用...Mac 下编译 Linux 和 Windows 64位可执行程序 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o Name main.go CGO_E...
  • 最近遇到的项目需要全编译Openblas,网上找了些资料,还是不能完美的做到编译成功,自己踏过坑后,现在整理一下,废话不说,开始全编译。1:配置android ndk环境现在地址:http://www.androiddevtools.cn/找到自己...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 2,843
精华内容 1,137
关键字:

linuxmacos编译arm

linux 订阅