View difference between Paste ID: 8cUQCHnn and 3PAncwWk
SHOW: | | - or go back to the newest paste.
1
~/$ cd opt/oecore-x86_64/
2
~/opt/oecore-x86_64/workspace$ source environment-setup-i586-oe-linux
3
~/opt/oecore-x86_64/workspace$ echo $CC
4
i586-oe-linux-gcc -m32 -march=i586 --sysroot=/home/christos/opt/oecore-x86_64/sysroots/i586-oe-linux
5
~/opt/oecore-x86_64/workspace$ which i586-oe-linux
6
~/opt/oecore-x86_64/workspace$ which i586-oe-linux-gcc/home/christos/opt/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/i586-oe-linux/i586-oe-linux-gcc
7
~/opt/oecore-x86_64/workspace$ i586-oe-linux-gcc main.c
8
main.c:1:19: fatal error: stdio.h: No such file or directory
9
 #include <stdio.h>
10
                   ^
11-
compilation terminated.
11+
compilation terminated.
12
13
~/$ cd opt/oecore-x86_64/
14
~/opt/oecore-x86_64/workspace$ source environment-setup-i586-oe-linux
15
~/opt/oecore-x86_64/workspace$ echo $CC
16
i586-oe-linux-gcc -m32 -march=i586 --sysroot=/home/christos/opt/oecore-x86_64/sysroots/i586-oe-linux
17
~/opt/oecore-x86_64/workspace$ which i586-oe-linux
18
~/opt/oecore-x86_64/workspace$ which i586-oe-linux-gcc/home/christos/opt/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/i586-oe-linux/i586-oe-linux-gcc
19
~/opt/oecore-x86_64/workspace$ i586-oe-linux-gcc main.c
20
main.c:1:19: fatal error: stdio.h: No such file or directory
21
 #include <stdio.h>
22
                   ^
23
compilation terminated.
24
25
~/opt/oecore-x86_64/workspace$ cd ..
26
~/opt/oecore-x86_64$ find . -name stdio.h
27
./sysroots/i586-oe-linux/usr/include/stdio.h
28
./sysroots/i586-oe-linux/usr/include/bits/stdio.h
29
./sysroots/i586-oe-linux/usr/include/c++/tr1/stdio.h
30
./sysroots/i586-oe-linux/usr/src/debug/eglibc/2.18-r0/eglibc-2.18/libc/include/stdio.h
31
./sysroots/i586-oe-linux/usr/src/debug/eglibc/2.18-r0/eglibc-2.18/libc/libio/stdio.h
32
./sysroots/i586-oe-linux/usr/src/debug/eglibc/2.18-r0/eglibc-2.18/libc/libio/bits/stdio.h
33
34
~/opt/oecore-x86_64/workspace$ make
35
i586-oe-linux-gcc  -m32 -march=i586 --sysroot=/home/christos/opt/oecore-x86_64/sysroots/i586-oe-linux -o maintest main.c
36
~/opt/oecore-x86_64/workspace$ ./maintest 
37
hello world
38
39
40
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
41
Makefile
42
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43
all: main.c
44
	$(CC) -o maintest main.c
45
46
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
47
main.c
48
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49
#include <stdio.h>
50
int main(void){
51
   printf("hello world\n");
52
   return 0;
53
}
54
55
Bottom line... Works from Makefile... doesn't work from bash command line.
56
environment setup needs some tweeking.