Build OpenSSL on Linux with -g for debugging

和自甴很熟 提交于 2019-12-04 02:41:34

You can follow the simple instructions mentioned here for building OpenSSL. For making a debug build, add the -d flag when you run ./config, i.e. ./config -d [other options]. Building OpenSSL is mentioned in detail here.

On new versions of OpenSSL, it looks like flags passed to ./Configure get injected directly into the gcc line when compiling. I just did ./Configure -g linux-x86_64 and successfully got debugging symbols in my build.

MichaelMoser

After running the regular configure step, do the following from the shell:

$ find . -name Makefile | xargs sed -i -e 's#-O3#-g#g'

It modifies the generated makefiles; instead of optimization option -O3 it puts in the -g option (generate debug symbols).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!