【问题标题】:How to compile ruby from source with debugging symbols on osx?如何在 osx 上使用调试符号从源代码编译 ruby​​?
【发布时间】:2018-01-10 04:01:03
【问题描述】:

我正在尝试使用调试符号从源代码编译 Ruby。我没有使用rbenvrvm等。

我已经试过了

./configure optflags="-O0" debugflags="-g3 -ggdb"

无济于事:((调试器声称它没有符号)

谢谢!

【问题讨论】:

    标签: ruby makefile compilation rbenv


    【解决方案1】:

    我最后想通了,你这样做:

    CFLAGS="-O0 -ggdb" ./configure

    【讨论】:

    • AFAICS ruby 默认为-O3-ggdb3(相当于-g3)。在完成之前./configure 报告它将使用哪些选项(CFLAGSoptflagsdebugflags)。 latter 适合调试,至于former 最好使用-Og 构建。要使用该运行./configure optflags=-Og
    【解决方案2】:

    我最近需要在 docker 容器中构建 ruby。这是我所做的:

    1.sh:

    #!/bin/sh
    set -eux
    apk add build-base autoconf bison linux-headers git ruby zlib-dev openssl-dev readline-dev libffi-dev gdbm-dev
    git clone https://github.com/ruby/ruby
    cd ruby
    git checkout v2_6_6
    autoconf
    ./configure optflags=-Og
    make install
    
    $ docker run --rm -itv $PWD:/app alpine:3.11 sh
    / # /app/1.sh
    

    【讨论】:

      猜你喜欢
      • 2012-04-25
      • 1970-01-01
      • 1970-01-01
      • 2019-05-12
      • 2011-07-28
      • 2014-03-31
      • 2016-12-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多