File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1680,6 +1680,11 @@ fn addMega65Exe(
16801680 exe .root_module .linkLibrary (libs .crt );
16811681 exe .root_module .linkLibrary (libs .crt0 );
16821682 exe .root_module .linkLibrary (libs .c );
1683+ if (libs .printf ) | libprintf | exe .root_module .linkLibrary (libprintf );
1684+ if (libs .crt0_obj ) | obj | exe .root_module .addObject (obj );
1685+ if (libs .mem ) | mem_obj | exe .root_module .addObject (mem_obj );
1686+ exe .forceUndefinedSymbol ("__zig_call_main_section" );
1687+ exe .forceUndefinedSymbol ("main" );
16831688 exe .setLibCFile (libc_txt );
16841689 exe .root_module .link_libc = true ;
16851690 exe .setLinkerScript (wrapper_ld );
Original file line number Diff line number Diff line change @@ -129,34 +129,3 @@ export fn main() void {
129129 while (true ) draw ();
130130}
131131
132- /// Satisfy crt0's __zero_bss / compiler-generated memory ops (no C stdlib linked).
133- export fn __memset (dest : [* ]u8 , c : u32 , n : usize ) [* ]u8 {
134- var i : usize = 0 ;
135- while (i < n ) : (i += 1 ) dest [i ] = @truncate (c );
136- return dest ;
137- }
138-
139- export fn memset (dest : [* ]u8 , c : c_int , n : usize ) [* ]u8 {
140- var i : usize = 0 ;
141- while (i < n ) : (i += 1 ) dest [i ] = @truncate (@as (c_uint , @bitCast (c )));
142- return dest ;
143- }
144-
145- export fn memcpy (noalias dest : [* ]u8 , noalias src : [* ]const u8 , n : usize ) [* ]u8 {
146- @memcpy (dest [0.. n ], src [0.. n ]);
147- return dest ;
148- }
149-
150- export fn memmove (dest : [* ]u8 , src : [* ]const u8 , n : usize ) [* ]u8 {
151- if (@intFromPtr (dest ) < @intFromPtr (src )) {
152- var i : usize = 0 ;
153- while (i < n ) : (i += 1 ) dest [i ] = src [i ];
154- } else {
155- var i : usize = n ;
156- while (i > 0 ) {
157- i -= 1 ;
158- dest [i ] = src [i ];
159- }
160- }
161- return dest ;
162- }
You can’t perform that action at this time.
0 commit comments