File tree Expand file tree Collapse file tree 6 files changed +80
-0
lines changed Expand file tree Collapse file tree 6 files changed +80
-0
lines changed Original file line number Diff line number Diff line change
1
+ # currently many works; neither one nor two, nor mix work
2
+ # one possibility is to do each .c file in turn
3
+ # essentially turning one and two into many.
4
+ #
5
+ # two strategies:
6
+
7
+ # the important
8
+ # point is to make sure for each generated .*.bc file that
9
+ # there is a corresponding *.o file. so we may have to alter
10
+ # both "stages" of the compilation, or extend the second one substantially.
11
+
12
+ # just alter the second phase to get the many.
13
+ # Including the thing we are not supposed be able to do
14
+ # which is attach the bit bitcode paths directly to the executable.
15
+ # in the mix version we will need to to append to a section. which
16
+ # has to be done by reading, removing then wrtiting the section.
17
+
18
+ zero :
19
+ ${CXX} hello.cc -o hello
20
+
21
+ one :
22
+ ${CC} foo.c bar.c baz.c main.c -o main
23
+
24
+ two :
25
+ ${CC} foo.c bar.c baz.c main.c -c
26
+ ${CC} foo.o bar.o baz.o main.o -o main
27
+
28
+ mix :
29
+ ${CC} foo.c bar.c -c
30
+ ${CC} foo.o bar.o baz.c main.c -o main
31
+
32
+ many :
33
+ ${CC} foo.c -c
34
+ ${CC} bar.c -c
35
+ ${CC} baz.c -c
36
+ ${CC} main.c -c
37
+ ${CC} -Ioff/in/lala/land -I some/where/else foo.o bar.o baz.o main.o -lm -Lz -o main
38
+
39
+
40
+ clean :
41
+ rm -f * .o main .* .o.bc .* .o * .bc .* .bc a.out * .s * .i hello
42
+
Original file line number Diff line number Diff line change
1
+ #include <stdio.h>
2
+
3
+
4
+ void bar (void ){
5
+ fprintf (stderr , "bar\n" );
6
+ }
Original file line number Diff line number Diff line change
1
+ #include <stdio.h>
2
+
3
+
4
+ void baz (void ){
5
+ fprintf (stderr , "baz\n" );
6
+ }
Original file line number Diff line number Diff line change
1
+ #include <stdio.h>
2
+
3
+
4
+ void foo (void ){
5
+ fprintf (stderr , "foo\n" );
6
+ }
Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+
3
+
4
+ int main (int argc, char ** argv){
5
+
6
+ std::cout << " Hello World" << std::endl;
7
+
8
+ return 0 ;
9
+ }
Original file line number Diff line number Diff line change
1
+
2
+ extern void foo (void );
3
+ extern void bar (void );
4
+ extern void baz (void );
5
+
6
+ int main (int argc , char * * argv ){
7
+ foo ();
8
+ bar ();
9
+ baz ();
10
+ return 0 ;
11
+ }
You can’t perform that action at this time.
0 commit comments