Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instructions to build and run are in README.fuchsia. R=asiva@google.com Review URL: https://codereview.chromium.org/2117593002 .
- Loading branch information
Showing
42 changed files
with
1,608 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
This is a README file describing how to build Dart for Fuchsia. It assumes that | ||
you have built the magenta kernel under //magenta, its toolchains are | ||
under //toolchains, and that you have a Dart checkout under //dart. It is early | ||
days and this is crufty. The process will improve from here. | ||
|
||
1. First, set up some symlinks in your Dart checkout: | ||
|
||
//dart/third_party/fuchsia_tools/toolchains | ||
-> symlinked to //toolchains | ||
//dart/third_party/fuchsia_tools/sysroot/x86_64/usr | ||
-> symlinked to //magenta/build-magenta-qemu-x86-64/sysroot/ | ||
|
||
Also, copy the linker script: | ||
|
||
//magenta$ cp kernel/arch/x86/64/user.ld build-magenta-qemu-x86-64/sysroot/ | ||
|
||
and similarly for arm64. | ||
|
||
2. Build: | ||
|
||
//dart$ tools/build.py -m product -a x64 --os=fuchsia fuchsia_test | ||
|
||
This will produce //dart/out/ProductFuchsiaX64/fuchsia_test | ||
|
||
3. Strip it: | ||
|
||
//dart$ third_party/fuchsia_tools/toolchains/x86_64-elf-5.3.0-Linux-x86_64/bin/x86_64-elf-strip out/ProductFuchsiaX64/fuchsia_test -o out/ProductFuchsiaX64/fuchsia_test.stripped | ||
|
||
4. Make a file //magenta/fuchsia_test.manifest containing: | ||
|
||
bin/fuchsia_test=//dart/out/ProductFuchsiaX64/fuchsia_test.stripped | ||
|
||
Where //dart is the actual path to your Dart checkout. | ||
|
||
5. Make an extra bootfs: | ||
|
||
//magenta$ build-magenta-qemu-x86-64/tools/mkbootfs -o fuchsia_test.bootfs fuchsia_test.manifest | ||
|
||
6. Run: | ||
|
||
//magenta$ ./scripts/run-magenta-x86-64 -x fuchsia_test.bootfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include <dart_api.h> | ||
|
||
int main(void) { | ||
fprintf(stderr, "Calling Dart_SetVMFlags\n"); | ||
fflush(stderr); | ||
if (!Dart_SetVMFlags(0, NULL)) { | ||
fprintf(stderr, "Failed to set flags\n"); | ||
fflush(stderr); | ||
return -1; | ||
} | ||
fprintf(stderr, "Calling Dart_Initialize\n"); | ||
fflush(stderr); | ||
char* error = Dart_Initialize( | ||
NULL, NULL, NULL, | ||
NULL, NULL, NULL, NULL, | ||
NULL, | ||
NULL, | ||
NULL, | ||
NULL, | ||
NULL, | ||
NULL, | ||
NULL); | ||
if (error != NULL) { | ||
fprintf(stderr, "VM initialization failed: %s\n", error); | ||
fflush(stderr); | ||
free(error); | ||
return -1; | ||
} | ||
fprintf(stderr, "Success!\n"); | ||
fflush(stderr); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
#ifndef PLATFORM_UTILS_FUCHSIA_H_ | ||
#define PLATFORM_UTILS_FUCHSIA_H_ | ||
|
||
#include "platform/assert.h" | ||
|
||
namespace dart { | ||
|
||
inline int Utils::CountLeadingZeros(uword x) { | ||
UNIMPLEMENTED(); | ||
return 0; | ||
} | ||
|
||
|
||
inline int Utils::CountTrailingZeros(uword x) { | ||
UNIMPLEMENTED(); | ||
return 0; | ||
} | ||
|
||
|
||
inline uint16_t Utils::HostToBigEndian16(uint16_t value) { | ||
UNIMPLEMENTED(); | ||
return 0; | ||
} | ||
|
||
|
||
inline uint32_t Utils::HostToBigEndian32(uint32_t value) { | ||
UNIMPLEMENTED(); | ||
return 0; | ||
} | ||
|
||
|
||
inline uint64_t Utils::HostToBigEndian64(uint64_t value) { | ||
UNIMPLEMENTED(); | ||
return 0; | ||
} | ||
|
||
|
||
inline uint16_t Utils::HostToLittleEndian16(uint16_t value) { | ||
UNIMPLEMENTED(); | ||
return 0; | ||
} | ||
|
||
|
||
inline uint32_t Utils::HostToLittleEndian32(uint32_t value) { | ||
UNIMPLEMENTED(); | ||
return 0; | ||
} | ||
|
||
|
||
inline uint64_t Utils::HostToLittleEndian64(uint64_t value) { | ||
UNIMPLEMENTED(); | ||
return 0; | ||
} | ||
|
||
|
||
inline char* Utils::StrError(int err, char* buffer, size_t bufsize) { | ||
UNIMPLEMENTED(); | ||
return NULL; | ||
} | ||
|
||
} // namespace dart | ||
|
||
#endif // PLATFORM_UTILS_FUCHSIA_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
#ifndef VM_ATOMIC_FUCHSIA_H_ | ||
#define VM_ATOMIC_FUCHSIA_H_ | ||
|
||
#if !defined VM_ATOMIC_H_ | ||
#error Do not include atomic_fuchsia.h directly. Use atomic.h instead. | ||
#endif | ||
|
||
#if !defined(TARGET_OS_FUCHSIA) | ||
#error This file should only be included on Fuchsia builds. | ||
#endif | ||
|
||
#include "platform/assert.h" | ||
|
||
namespace dart { | ||
|
||
inline uintptr_t AtomicOperations::FetchAndIncrement(uintptr_t* p) { | ||
UNIMPLEMENTED(); | ||
return 0; | ||
} | ||
|
||
|
||
inline void AtomicOperations::IncrementBy(intptr_t* p, intptr_t value) { | ||
UNIMPLEMENTED(); | ||
} | ||
|
||
|
||
inline void AtomicOperations::IncrementInt64By(int64_t* p, int64_t value) { | ||
UNIMPLEMENTED(); | ||
} | ||
|
||
|
||
inline uintptr_t AtomicOperations::FetchAndDecrement(uintptr_t* p) { | ||
UNIMPLEMENTED(); | ||
return 0; | ||
} | ||
|
||
|
||
inline void AtomicOperations::DecrementBy(intptr_t* p, intptr_t value) { | ||
UNIMPLEMENTED(); | ||
} | ||
|
||
|
||
#if !defined(USING_SIMULATOR_ATOMICS) | ||
inline uword AtomicOperations::CompareAndSwapWord(uword* ptr, | ||
uword old_value, | ||
uword new_value) { | ||
UNIMPLEMENTED(); | ||
return 0; | ||
} | ||
|
||
|
||
inline uint32_t AtomicOperations::CompareAndSwapUint32(uint32_t* ptr, | ||
uint32_t old_value, | ||
uint32_t new_value) { | ||
UNIMPLEMENTED(); | ||
return 0; | ||
} | ||
#endif // !defined(USING_SIMULATOR_ATOMICS) | ||
|
||
} // namespace dart | ||
|
||
#endif // VM_ATOMIC_FUCHSIA_H_ |
Oops, something went wrong.