嵌入式linux段错误,在嵌入式Linux上使用C Std Lib时出现异常的段错误
通過一些研究后我可以看到,vivado是硬件開發IDE [因為它們提供了一個試用期 – 所以它是硬件開發,他們總是想要收費].
如果您使用的是Xilinx的標準SDK板,則應該預先配置所有內容.否則,硬件設計師會生成一個具有Microblaze的硬件設計.
從那時起,您可能必須使用petalinux來生成兼容的新引導,內核等圖像.
您可能需要從源代碼重建libstdc,但我會將其作為最后的手段.例如,不要打擾它,直到你有gdb工作并有測試結果.
開發指南顯示了如何調用gdb(例如):
在目標系統上:
gdbserver主機:1534 / bin / myapp
在開發系統上:
petalinux-utils –gdb myapp后跟目標遠程192.168.0.10:1534
我已經使用注釋對Makefile進行了一些編輯.我已經評論了一些非必要的選項.請注意,我正在使用=運算符逐漸構建CFLAGS / CXXFLAGS
這里的基本思想是以最小的“標準”偏差進行構建.僅添加經過驗證的基本選項構建和測試.逐個添加選項[每次重建和測試],直到找到導致問題的選項.
然而,我確實懷疑 – 共同 – 是一個問題的根源.此外,在較小的程度上,我有點懷疑-Wl,– 根據需要
這些選項應該有效嗎?當然,但xilinx / microblaze不是沒有x86 ……
我添加了兩個命令行make變量:
DEBUG – 使用gdb生成調試
VERBOSE – 顯示構建過程的所有內容
例如,嘗試make< whatever> DEBUG = 1 VERBOSE = 1
CC = microblazeel-xilinx-linux-gnu-gcc
CXX = microblazeel-xilinx-linux-gnu-g++
CPPFLAGS ?=
CMFLAGS += -Wall -Werror
CMFLAGS += -fmessage-length=0
# compile for gdb session
# NOTES:
# (1) -gdwarf-2 may or may not be the the right option for microblaze
# (2) based on doc for -feliminate-unused-debug* petalinux/microblaze may want
# stabs format
ifdef DEBUG
CMFLAGS += -gdwarf-2
CMFLAGS += -O0
# compile for normal build
#else
CMFLAGS += -O2
CMFLAGS += -feliminate-unused-debug-types
endif
# NOTE: I used to use "@" on commands,but now I leave it off -- debug or not
# sure it's "ugly" but you can get used to it pretty quickly--YMMV
ifndef VERBOSE
Q :=
else
###Q := @
Q :=
endif
# let compiler/linker tell you _everything_:
# (1) configure options when tool was built
# (2) library search paths
# (3) linker scripts being used
ifdef VERBOSE
CMFLAGS += -v
LDFLAGS += -Wl,--verbose=2
endif
CMFLAGS += -fno-builtin
# NOTE: I'd _really_ leave this off as it may confuse c++ std as "<
# _M_insert (which is in the library,which is almost certainly _not_ using
# -fno-common)
###CMFLAGS += -fno-common
# NOTE: I'm also suspicIoUs of this a little bit because the c++ lib may have
# some "weak" symbols that the c library doesn't
###LDFLAGS += -Wl,--as-needed
# NOTE: this seems harmless enough,but you can comment it out to see if it
# helps
LDFLAGS += -Wl,--hash-style=gnu
# NOTE: an optimization only
ifndef DEBUG
LDFLAGS += -Wl,-O1
endif
CFLAGS += $(CMFLAGS)
CXXFLAGS += $(CMFLAGS)
# NOTES:
# (1) leave this off for now -- doesn't save _that_ much and adds complexity
# to the build
# (2) IMO,I _never_ use it and I erase/uninstall it on any system I
# administrate (or just ensure the build doesn't use it by removing it
# from $PATH)--YMMV
###XCCACHE = $(CCACHE)
# to compile
$(Q)$(XCCACHE) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CFLAGS) $< -o "$@"
# to link
$(Q)$(CXX) $(RELOBJECTS) $(LDFLAGS) $(EXT_LIBS) -o $(RELBINARY)
總結
以上是生活随笔為你收集整理的嵌入式linux段错误,在嵌入式Linux上使用C Std Lib时出现异常的段错误的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 蛤蜊肉,瘦肉丸子,西红柿,豆腐,可以一起
- 下一篇: 自己做的面包为什么不够甜?