我正在为ARM-CORTEX-A9尝试一个简单的交叉编译(cc):为了简单起见,这就是c代码:
#include <stdio.h>
int main()
{
printf("Hello World!\n");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
arm上的本机编译工作正常,并gcc helloworld.c -o helloworld以交叉编译开始时开始arm-xilinx-linux-gnueabi-gcc helloworld.c -o helloworld_cc
GCC版本:
NATIV: gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) Target: arm-linux-gnueabihf
CC: gcc version 4.6.3 (Sourcery CodeBench Lite 2012.03-79) Target: arm-xilinx-linux-gnueabi
来自readelf的ABI:
readelf-nativ:OS: Linux, ABI: 2.6.31
readelf-cc:OS: Linux, ABI: 2.6.16
链接库 - 交叉编译是静态链接的,所以它不应该错过任何库:
root@localhost:/temp# ldd helloworld
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6ed8000)
/lib/ld-linux-armhf.so.3 (0xb6fce000)
root@localhost:/temp# ldd helloworld_cc
not a dynamic executable
Run Code Online (Sandbox Code Playgroud)
问题:本机程序运行正常,cc总是以:
root@localhost:/tmp# ./helloworld_cc
-bash: ./helloworld_cc: No such file or …Run Code Online (Sandbox Code Playgroud) 之前我问了一个关于VerticalRulers的问题,我提到了这个提示我在VerticalRuler中添加了第二个Column并尝试添加一个Marker,但Marker总是出现在标准Column上,但不在我的上面.我添加了第二个行号列来说明我的问题.我该如何改变这种行为?谢谢你的帮助.
@Override
protected IVerticalRuler createVerticalRuler(){
IVerticalRuler ruler = super.createVerticalRuler();
ruler2 = (CompositeRuler) ruler;
column1 = new AnnotationRulerColumn(100);
ruler2.addDecorator(0, column1);
ruler2.addDecorator(2, createLineNumberRulerColumn());
column1.addAnnotationType("MARKER");
return ruler;
}
public String check_line(){
IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
IFileEditorInput input = (IFileEditorInput)editor.getEditorInput() ;
IFile file = input.getFile();
IResource res = (IResource) file;
try{
IMarker m = res.createMarker(IMarker.MARKER);
m.setAttribute(IMarker.LINE_NUMBER,2);
m.setAttribute(IMarker.MESSAGE, "lala");
m.setAttribute(IMarker.TEXT, "test");
m.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
m.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO);
} catch (CoreException e) { ... }
return "marker created";
}
Run Code Online (Sandbox Code Playgroud)

您好我用RT-Patch修补了Linux内核,并使用监视延迟的Cyclinctest对其进行了测试.内核不是很好,也不比vanilla内核好. https://rt.wiki.kernel.org/index.php/Cyclictest
我检查了uname的RT,看起来很好.
所以我检查了cyclinctest的要求,并指出我必须确保在内核配置中配置以下内容:
CONFIG_PREEMPT_RT=y
CONFIG_WAKEUP_TIMING=y
CONFIG_LATENCY_TRACE=y
CONFIG_CRITICAL_PREEMPT_TIMING=y
CONFIG_CRITICAL_IRQSOFF_TIMING=y
Run Code Online (Sandbox Code Playgroud)
现在出现的问题是配置不包含此类条目.也许有旧的,它们可能会在新的补丁版本(3.8.14)中重命名?
我找到了以下选项:
CONFIG_PREEMPT_RT_FULL=y
CONFIG_PREEMPT=y
CONFIG_PREEMPT_RT_BASE=y
CONFIG_HIGH_RES_TIMERS=y
Run Code Online (Sandbox Code Playgroud)
这是在3.x内核中提供从上面提供所需的吗?有人提示吗?
为了使用vfp或者neon,我添加了-mfpu = vfp和-mfloat-abi =我的交叉编译很难.该程序是一个非常简单的hellofloat.cpp,然后使用Sourcery CodeBench Lite 2013.05-24不再编译.
#include <string>
#include <iostream>
using namespace std;
int main()
{
double val=1.04;
cout << "Hello Float: " << val << endl;
}
Run Code Online (Sandbox Code Playgroud)
编译指令:
arm-none-linux-gnueabi-g++ -o armhf-main main.cpp -march=armv7-a -mfloat-abi=hard -mfpu=neon
Run Code Online (Sandbox Code Playgroud)
我很困惑,因为Codesorcery应该支持armhf编译?
错误:
In file included from /home/user/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../arm-none-linux-gnueabi/libc/usr/include/features.h:399:0,
from /home/user/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/include/c++/4.7.3/arm-none-linux-gnueabi/bits/os_defines.h:40,
from /home/user/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/include/c++/4.7.3/arm-none-linux-gnueabi/bits/c++config.h:414,
from /home/user/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/include/c++/4.7.3/string:40,
from main.cpp:1:
/home/user/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../arm-none-linux-gnueabi/libc/usr/include/gnu/stubs.h:10:29: fatal error: gnu/stubs-hard.h: No such file or directory
compilation terminated.
Run Code Online (Sandbox Code Playgroud)
编译器
arm-none-linux-gnueabi-g++ -v
Using built-in specs.
COLLECT_GCC=arm-none-linux-gnueabi-g++
COLLECT_LTO_WRAPPER=/home/user/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../libexec/gcc/arm-none-linux-gnueabi/4.7.3/lto-wrapper
Target: arm-none-linux-gnueabi
Configured with: /scratch/jbrown/2013.05-arm-linux-release/src/gcc-4.7-2013.05/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads …Run Code Online (Sandbox Code Playgroud) 我在notepad ++中设计了自己的用户自定义语言.要真正使用它,将它分配给特定的文件结尾将是非常好的吗?有谁知道这是怎么做到的吗?感谢帮助
eactor
可以使用文档类型描述(DTD)或XML架构(xsd)定义和验证XML文件,如下所示:
<?xml version='1.0' encoding='UTF-8'?>
<annotation xmlns="http://www.xyz.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xyz.com
file:system.xsd" >
Run Code Online (Sandbox Code Playgroud)
要么
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE annotation SYSTEM "http://www.xyz.de/system.dtd">
Run Code Online (Sandbox Code Playgroud)
两种方式都定义了找到DTD或XSD的URL.有没有办法给出相对或本地路径?所以我可以将它们与XML文件一起存储,而不是依赖于服务器?
我正在使用fread读取文件的第一个字节:
fread(&example_struct, sizeof(example_struct), 1, fp_input);
Run Code Online (Sandbox Code Playgroud)
哪个在linux和solaris下结果不同?那么example_struct(Elf32_Ehdr)是elf.h中定义的Standart GNU C Liborary的一部分?我很高兴知道为什么会这样?
一般结构看起来如下:
typedef struct
{
unsigned char e_ident[LENGTH];
TYPE_Half e_type;
} example_struct;
Run Code Online (Sandbox Code Playgroud)
调试代码:
for(i=0;paul<sizeof(example_struct);i++){
printf("example_struct->e_ident[%i]:(%x) \n",i,example_struct.e_ident[i]);
}
printf("example_struct->e_type: (%x) \n",example_struct.e_type);
printf("example_struct->e_machine: (%x) \n",example_struct.e_machine);
Run Code Online (Sandbox Code Playgroud)
Solaris输出:
Elf32_Ehead->e_ident[0]: (7f)
Elf32_Ehead->e_ident[1]: (45)
...
Elf32_Ehead->e_ident[16]: (2)
Elf32_Ehead->e_ident[17]: (0)
...
Elf32_Ehead->e_type: (200)
Elf32_Ehead->e_machine: (6900)
Run Code Online (Sandbox Code Playgroud)
Linux输出:
Elf32_Ehead->e_ident[0]: (7f)
Elf32_Ehead->e_ident[1]: (45)
...
Elf32_Ehead->e_ident[16]: (2)
Elf32_Ehead->e_ident[17]: (0)
...
Elf32_Ehead->e_type: (2)
Elf32_Ehead->e_machine: (69)
Run Code Online (Sandbox Code Playgroud)
也许类似于:http://forums.devarticles.com/cc-help-52/file-io-linux-and-solaris-108308.html
好的,这可能是一个非常笼统的问题,但是我不熟悉该主题,也很高兴获得任何提示。
我有一个来自SoucereyCodeBench的ARM交叉编译工具链(arm-xilinx-linux-gnueabi-)。我交叉编译了一个使用编译器选项的库:-DSC_INCLUDE_FX -DSC_USE_PTHREADS -pthreads -fPIC -DPIC
因此,如果我想将库用于裸机程序,那么我会为裸机编译器(arm-xilinx-eabi-)需要pthreads吗?
否则我的程序可能首先不会运行或编译。那么可以为裸机编译pthread吗?
arm ×3
embedded ×2
linux ×2
bare-metal ×1
c ×1
codesourcery ×1
dtd ×1
eclipse ×1
eclipse-rcp ×1
editor ×1
fread ×1
gcc ×1
kernel ×1
linux-kernel ×1
notepad++ ×1
real-time ×1
solaris ×1
xilinx ×1
xml ×1
xsd ×1