forked from aufover/rpm-divine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprefix_path.patch
162 lines (142 loc) · 6.29 KB
/
prefix_path.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
diff -rN -u a/divine/cc/driver.cpp b/divine/cc/driver.cpp
--- a/divine/cc/driver.cpp 2019-11-01 15:57:40.145739566 +0100
+++ b/divine/cc/driver.cpp 2019-11-01 15:57:40.145739566 +0100
@@ -211,7 +211,7 @@
compiler.allowIncludePath( "." ); // TODO: necessary?
compiler.allowIncludePath( brq::dirname( lib ) );
- dirs.insert( dirs.begin(), "/dios/lib" );
+ dirs.insert( dirs.begin(), "/opt/divine/include/dios/lib" );
for ( auto p : dirs )
for ( auto suf : suffixes )
for ( auto pref : { "lib", "" } )
@@ -225,7 +225,7 @@
std::string Driver::find_object( std::string name )
{
- return brq::join_path( "/dios/lib", name + ".bc"s );
+ return brq::join_path( "/opt/divine/include/dios/lib", name + ".bc"s );
}
Driver::ModulePtr Driver::load_object( std::string path )
diff -rN -u a/dbg/info.cpp b/divine/dbg/info.cpp
--- a/divine/dbg/info.cpp 2019-11-01 15:57:40.145739566 +0100
+++ b/divine/dbg/info.cpp 2019-11-01 15:57:40.145739566 +0100
@@ -59,28 +59,28 @@
if ( comp & component::libc )
{
- if ( brq::starts_with( file, "/dios/libc/" ) ||
- brq::starts_with( file, "/dios/arch/" ) ||
- brq::starts_with( file, "/dios/include/sys/" ) )
+ if ( brq::starts_with( file, "/opt/divine/include/dios/libc/" ) ||
+ brq::starts_with( file, "/opt/divine/include/dios/arch/" ) ||
+ brq::starts_with( file, "/opt/divine/include/dios/include/sys/" ) )
return true;
- if ( brq::starts_with( file, "/dios/include/" ) && file.substr( 14 ).find( '/' ) == file.npos )
+ if ( brq::starts_with( file, "/opt/divine/include/dios/include/" ) && file.substr( 33 ).find( '/' ) == file.npos )
return true;
}
if ( comp & component::libcxx )
- if ( brq::starts_with( file, "/dios/libcxx" ) )
+ if ( brq::starts_with( file, "/opt/divine/include/dios/libcxx" ) )
return true;
if ( comp & component::librst )
- if ( brq::starts_with( file, "/dios/rst/" ) ||
- brq::starts_with( file, "/dios/include/rst/" ) )
+ if ( brq::starts_with( file, "/opt/divine/include/dios/rst/" ) ||
+ brq::starts_with( file, "/opt/divine/include/dios/include/rst/" ) )
return true;
if ( comp & component::dios )
- if ( brq::starts_with( file, "/dios/sys/" ) || brq::starts_with( file, "/dios/vfs/" ) )
+ if ( brq::starts_with( file, "/opt/divine/include/dios/sys/" ) || brq::starts_with( file, "/opt/divine/include/dios/vfs/" ) )
return true;
- if ( comp & component::program && !brq::starts_with( file, "/dios/" ) )
+ if ( comp & component::program && !brq::starts_with( file, "/opt/divine/include/dios/" ) )
return true;
return false;
diff -rN -u a/divine/rt/dios-cc.cpp b/divine/rt/dios-cc.cpp
--- a/divine/rt/dios-cc.cpp 2019-11-01 15:57:40.145739566 +0100
+++ b/divine/rt/dios-cc.cpp 2019-11-01 15:57:40.145739566 +0100
@@ -30,10 +30,10 @@
void add_dios_header_paths( std::vector< std::string >& paths )
{
paths.insert( paths.end(),
- { "-isystem", "/dios/libcxx/include"
- , "-isystem", "/dios/libcxxabi/include"
- , "-isystem", "/dios/libunwind/include"
- , "-isystem", "/dios/include" } );
+ { "-isystem", "/opt/divine/include/dios/libcxx/include"
+ , "-isystem", "/opt/divine/include/dios/libcxxabi/include"
+ , "-isystem", "/opt/divine/include/dios/libunwind/include"
+ , "-isystem", "/opt/divine/include/dios/include" } );
}
void add_dios_defines( std::vector< std::string >& flags )
diff -rN -u a/divine/rt/runtime.cpp b/divine/rt/runtime.cpp
--- a/divine/rt/runtime.cpp 2019-11-01 15:57:40.145739566 +0100
+++ b/divine/rt/runtime.cpp 2019-11-01 15:57:40.145739566 +0100
@@ -33,9 +33,9 @@
if ( n == "libcxx.a" ) n = "libc++.a";
if ( n == "libcxxabi.a" ) n = "libc++abi.a";
if ( brq::ends_with( n, ".bc" ) || brq::ends_with( n, ".a" ) )
- return "/dios/lib/" + n;
+ return "/opt/divine/include/dios/lib/" + n;
else
- return "/dios/" + n;
+ return "/opt/divine/include/dios/" + n;
}
void each( std::function< void( std::string, std::string_view ) > yield )
diff -rN -u a/tools/runtime-cc.cpp b/tools/runtime-cc.cpp
--- a/tools/runtime-cc.cpp 2019-11-01 15:57:40.145739566 +0100
+++ b/tools/runtime-cc.cpp 2019-11-01 15:57:40.145739566 +0100
@@ -48,6 +48,7 @@
n = p.substr( srcDir.size() );
if ( brq::starts_with( p, binDir ) )
n = p.substr( binDir.size() );
+ n = "/opt/divine/include" + n;
TRACE( "rewrite", p, "to", n );
return n;
} );
diff -rN -u a/test/lang-cpp/can-catch.cpp b/test/lang-cpp/can-catch.cpp
--- a/test/lang-cpp/can-catch.cpp
+++ b/test/lang-cpp/can-catch.cpp
@@ -1,5 +1,5 @@
/* TAGS: min c++ */
-/* CC_OPTS: -I/dios */
+/* CC_OPTS: -I/opt/divine/include/dios */
#include <libcxxabi/src/private_typeinfo.h>
#include <memory>
#include <exception>
diff -rN -u a/test/sim/call-dbg.sh b/test/sim/call-dbg.sh
--- a/test/sim/call-dbg.sh
+++ b/test/sim/call-dbg.sh
@@ -15,7 +15,7 @@
int main() {}
EOF
-sim -std=c++17 -C,-I/,-I$SRCDIR/bricks file.cpp <<EOF
+sim -std=c++17 -C,-I/opt/divine/include,-I$SRCDIR/bricks file.cpp <<EOF
+ ^# executing __boot at
> start
> call use_debug
# assert
diff -u a/dios/libc/_PDCLIB/assert.c b/dios/libc/_PDCLIB/assert.c
--- a/dios/libc/_PDCLIB/assert.c 2019-11-21 15:21:35.671767809 +0100
+++ b/dios/libc/_PDCLIB/assert.c 2019-11-21 15:21:35.675101152 +0100
@@ -19,7 +19,20 @@
{
int masked = __dios_mask( 1 );
char buffer[ 200 ];
- snprintf( buffer, 200, "%s:%u: %s: assertion '%s' failed", file, line, fun, stmt );
+
+ const char * prefix = "/opt/divine/include";
+ const int prefix_len = strlen( prefix );
+
+ int shift = 0;
+ const char * bgn = strstr( file, "/dios/" );
+ if ( bgn != NULL ) {
+ file = bgn;
+ strcpy( buffer, prefix );
+ shift += prefix_len;
+ }
+
+ snprintf( buffer + shift, 200 - shift,
+ "%s:%u: %s: assertion '%s' failed", file, line, fun, stmt );
__dios_fault( _VM_F_Assert, buffer );
__dios_mask( masked );
}