Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Issue 1559053002: Refs #10260 OpenBSD support #25327

Created:
4 years, 11 months ago by mulander
Modified:
4 years, 7 months ago
Reviewers:
ricow1, Ivan Posva
CC:
reviews_dartlang.org, ricow1, vm-dev_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Refs #10260 OpenBSD support #25327 This branch adds support for the OpenBSD platform form issue #10260 For current status update please see: https://github.com/dart-lang/sdk/issues/10260#issuecomment-168332554 At the time of opening this pull request: - the runtime can be built - the sdk can be built - 3780 passed; 5 failed; - see #10260 for details. - ongoing work to build the 'all' target Full test run: - 13514 passed; 71 failed - SDK path failures are related to a still not implemented workaround for procfs All tests & porting done on OpenBSD -current snapshot from Dec 19th 2015 amd64 ---- changelog follows ---- Merge branch 'OpenBSD-support' into upstream-OpenBSD-support Linter changes Merge branch 'OpenBSD-support' into upstream-OpenBSD-support More linter changes Merge branch 'OpenBSD-support' into upstream-OpenBSD-support Make the linter happy Merge branch 'OpenBSD-support' into upstream-OpenBSD-support Merge branch 'master' of https://github.com/dart-lang/sdk into OpenBSD-support Include pthreads in the linking phase Use Directory::SystemTemp from Linux instead of android hard coded path Implement cpuinfo for OpenBSD using cpuid path from linux Add OpenBSD to CheckedInSdkPath This is used during the build for observatory_tool.py it will attempt to download an SDK from google but there's none yet for OpenBSD. This allows the build moving forward with a warning being printed that this system can't run the SDK and that debug builds will be slow with the bootstrap dart. Assuming that upstream will pick up the port this should not be the case in the future. Enable building boringssl for OpenBSD using the linux sources Add stdio_openbsd.cc based on stdio_android.cc Implement a stub file system watcher for OpenBSD There is no inotify like API available on OpenBSD Follow upstream and add Utils::StrError based on Android implementation Follow upstream extensions_openbsd changes Follow upstream os_openbsd changes Follow upstream by adding Platform::Exit for OpenBSD Follow upstream refactorings - using Utils::StrError - renaming GetCurrentTimeMilliseconds -> GetCurrentMonotonicMillis etc. Adjust to upstream os_thread & thread_interrupter changes Merge branch 'master' into OpenBSD-support Merge branch 'master' into OpenBSD-support Add runtime/vm/native_symbol_openbsd.cc based on android Add runtime/bin/utils_openbsd.cc based on android Fix typo Fix ifdef guard Add runtime/vm/signal_handler_openbsd.cc based on linux Use mcontext.sc_eip/rip etc instead of gregs Add runtime/vm/virtual_memory_openbsd.cc based on android Handle obtaining mcontext_t in thread_interrupter Add runtime/vm/thread_interrupter_openbsd.cc based on linux Add runtime/bin/fdutils_openbsd.cc based on fdutils_linux.cc Implement debuginfo & gdbjit based on linux Change if guardst Add runtime/bin/process_openbsd.cc based on process_android.cc Mark whole cpuinfo_openbsd.cc as UNIMPLEMENTED(); Add runtime/vm/cpuinfo_openbsd.cc based on cpuinfo_linux.cc Add runtime/bin/extensions_openbsd.cc based on extensions_linux.cc Add crypto_openbsd.cc and mark a FIXME for getentropy(2) Include platform_openbsd.cc in build files Handle environ for OpenBSD, add FIXME for procfs & minor tweaks execve(2) makes environ available when a process begins the handling matches what process_android does. Add runtime/bin/platform_openbsd.cc based on platform_linux.cc Proper OS::Name() & if preprocessor guard Switch to posix_memalign & use getthrid() instead of a syscall Add runtime/vm/os_openbsd.cc based on os_linux.cc Reinterpret cast on ThreadIdFromIntPtr Include os_thread_openbsd.{h,cc} in the build Add runtime/bin/log_openbsd.cc based on log_linux.cc Fix conditional include copy pasta OpenBDS does have mkdtemp so drop the helper function Add missing include for sys/socket.h Add runtime/bin/file_openbsd.cc based on android Add runtime/bin/directory_openbsd.cc based on android More gypi sources to update Add runtime/dart-runtime.gyp for openbsd based on linux Drop -lrt & -ldl for OpenBSD in vm.gypi Add OpenBSD to vm.gypi Add runtime/bin/eventhandler_openbsd.{h,cc} based on macos for kqueue Add runtime/bin/socket_openbsd.{h,cc} based on macos Add runtime/bin/dbg_connection.{h,cc} based on macos for kqueue Account for thread API differences between Android & OpenBSD Add runtime/bin/thread_openbsd.cc based on thread_android.cc Add runtime/bin/thread_openbsd.h based on thread_android.h Merge branch 'master' into OpenBSD-support Handle ucontext.h in signal_handler.h Add runtime/vm/atomic.h & atomic_openbsd.h Based on atomic_linux.h Add platform/utils_openbsd.cc based on utils_linux.cc Add os_thread for OpenBSD based on Android Fix case for the OpenBSD platform Define OpenBSD target OS in runtime/platform/globals.h Make the build tool recognize OpenBSD We use `gmake` like FreeBSD to use the GNU Make Add configurations_openbsd.gypi With this step we can generate Makefiles from a fresh gclient sync call: /usr/local/bin/python sdk/tools/gyp_dart.py The file is a 1:1 copy of configurations_make.gypi which contained Linux only targets but previous attempts at porting the software to OpenBSD have shown that one can get really far with that setup using those defaults. Add OpenBSD as a dart target os This opens up a can of worms of course but let's do things properly and one small step at a time. This change impacts: /usr/local/bin/python sdk/tools/gyp_dart.py which is automatically called by gclient sync and now will faile with missing configuration targets for Dart_OpenBSD_Base. Without the change the error would just slap you with a generic unsupported os message. One can of course set the target os to Linux which would get you much further along with far less effort but that's a bit ugly solution. BUG=

Patch Set 1 #

Total comments: 21

Patch Set 2 : Address code review comments #

Patch Set 3 : Replace // FIXME with // TODO(mulander) #

Total comments: 25

Patch Set 4 : Address code review issues #

Unified diffs Side-by-side diffs Delta from patch set Stats (+325 lines, -216 lines) Patch
M runtime/bin/BUILD.gn View 3 chunks +3 lines, -0 lines 0 comments Download
M runtime/bin/bin.gypi View 1 4 chunks +8 lines, -0 lines 0 comments Download
M runtime/bin/builtin_impl_sources.gypi View 4 chunks +8 lines, -0 lines 0 comments Download
A + runtime/bin/crypto_openbsd.cc View 1 2 3 3 chunks +3 lines, -2 lines 0 comments Download
A + runtime/bin/directory_openbsd.cc View 1 2 3 5 chunks +8 lines, -3 lines 0 comments Download
M runtime/bin/eventhandler.h View 1 chunk +2 lines, -0 lines 0 comments Download
A + runtime/bin/eventhandler_openbsd.h View 2 chunks +4 lines, -4 lines 0 comments Download
A + runtime/bin/eventhandler_openbsd.cc View 3 chunks +4 lines, -4 lines 0 comments Download
A + runtime/bin/extensions_openbsd.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
A + runtime/bin/fdutils_openbsd.cc View 1 2 3 3 chunks +2 lines, -3 lines 0 comments Download
A + runtime/bin/file_openbsd.cc View 1 2 3 9 chunks +20 lines, -28 lines 0 comments Download
A runtime/bin/file_system_watcher_openbsd.cc View 1 chunk +61 lines, -0 lines 0 comments Download
M runtime/bin/io_impl_sources.gypi View 4 chunks +7 lines, -0 lines 0 comments Download
A + runtime/bin/log_openbsd.cc View 2 chunks +2 lines, -2 lines 0 comments Download
A + runtime/bin/platform_openbsd.cc View 1 2 5 chunks +5 lines, -3 lines 0 comments Download
A + runtime/bin/process_openbsd.cc View 5 chunks +4 lines, -5 lines 0 comments Download
M runtime/bin/socket.h View 1 chunk +2 lines, -0 lines 0 comments Download
A + runtime/bin/socket_openbsd.h View 1 chunk +3 lines, -3 lines 0 comments Download
A + runtime/bin/socket_openbsd.cc View 4 chunks +5 lines, -3 lines 0 comments Download
A + runtime/bin/stdio_openbsd.cc View 1 3 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/bin/thread.h View 1 chunk +2 lines, -0 lines 0 comments Download
A + runtime/bin/thread_openbsd.h View 2 chunks +4 lines, -4 lines 0 comments Download
A + runtime/bin/thread_openbsd.cc View 4 chunks +6 lines, -5 lines 0 comments Download
A + runtime/bin/utils_openbsd.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/dart-runtime.gyp View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/platform/globals.h View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/platform/utils.h View 1 chunk +2 lines, -0 lines 0 comments Download
A + runtime/platform/utils_openbsd.h View 2 chunks +3 lines, -3 lines 0 comments Download
M runtime/vm/atomic.h View 1 chunk +2 lines, -0 lines 0 comments Download
A + runtime/vm/atomic_openbsd.h View 2 chunks +6 lines, -6 lines 0 comments Download
A + runtime/vm/cpuinfo_openbsd.cc View 1 5 chunks +10 lines, -22 lines 0 comments Download
A + runtime/vm/debuginfo_openbsd.cc View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
A + runtime/vm/gdbjit_openbsd.h View 2 chunks +3 lines, -3 lines 0 comments Download
A + runtime/vm/gdbjit_openbsd.cc View 2 chunks +3 lines, -3 lines 0 comments Download
A + runtime/vm/native_symbol_openbsd.cc View 2 chunks +2 lines, -2 lines 0 comments Download
A + runtime/vm/os_openbsd.cc View 1 2 3 5 chunks +7 lines, -9 lines 0 comments Download
M runtime/vm/os_thread.h View 1 chunk +2 lines, -0 lines 0 comments Download
A + runtime/vm/os_thread_openbsd.h View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
A + runtime/vm/os_thread_openbsd.cc View 1 2 3 10 chunks +11 lines, -12 lines 0 comments Download
M runtime/vm/signal_handler.h View 1 chunk +3 lines, -0 lines 0 comments Download
A + runtime/vm/signal_handler_openbsd.cc View 6 chunks +9 lines, -27 lines 0 comments Download
A + runtime/vm/thread_interrupter_openbsd.cc View 6 chunks +7 lines, -8 lines 0 comments Download
A + runtime/vm/virtual_memory_openbsd.cc View 3 chunks +3 lines, -5 lines 0 comments Download
M runtime/vm/vm.gypi View 1 3 chunks +21 lines, -0 lines 0 comments Download
M runtime/vm/vm_sources.gypi View 9 chunks +11 lines, -0 lines 0 comments Download
M third_party/boringssl/boringssl_dart.gyp View 1 chunk +1 line, -1 line 0 comments Download
M tools/build.py View 1 2 chunks +3 lines, -2 lines 0 comments Download
M tools/gyp/all.gypi View 1 chunk +5 lines, -0 lines 0 comments Download
M tools/gyp/configurations.gypi View 2 chunks +2 lines, -0 lines 0 comments Download
A + tools/gyp/configurations_openbsd.gypi View 13 chunks +25 lines, -30 lines 0 comments Download
M tools/utils.py View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 9 (1 generated)
ricow1
+Ivan for actual review Just a few fast comments: It seems to me that a ...
4 years, 11 months ago (2016-01-05 07:12:13 UTC) #2
ricow1
https://codereview.chromium.org/1559053002/diff/1/runtime/bin/bin.gypi File runtime/bin/bin.gypi (right): https://codereview.chromium.org/1559053002/diff/1/runtime/bin/bin.gypi#newcode905 runtime/bin/bin.gypi:905: }], trailing whitespace https://codereview.chromium.org/1559053002/diff/1/runtime/vm/vm.gypi File runtime/vm/vm.gypi (right): https://codereview.chromium.org/1559053002/diff/1/runtime/vm/vm.gypi#newcode140 runtime/vm/vm.gypi:140: ...
4 years, 11 months ago (2016-01-05 07:36:45 UTC) #3
mulander
> +Ivan for actual review > Just a few fast comments: > It seems to ...
4 years, 11 months ago (2016-01-05 11:31:03 UTC) #4
mulander
Uploaded a new patch set addressing all raised issues. Sorry if it' a bit spammy ...
4 years, 11 months ago (2016-01-05 16:13:49 UTC) #5
mulander
It's been 6 days since any feedback. Is there anything else I need to do ...
4 years, 11 months ago (2016-01-11 17:51:55 UTC) #6
Ivan Posva
I would like to understand why the files are name *_openbsd.[h|cc]. I do not expect ...
4 years, 11 months ago (2016-01-11 23:58:40 UTC) #7
mulander
Regarding file naming, if you look at my previous comment - https://codereview.chromium.org/1559053002/#msg4: Regarding shared code ...
4 years, 11 months ago (2016-01-12 00:22:46 UTC) #8
mulander
4 years, 11 months ago (2016-01-12 00:59:39 UTC) #9
This issue will not be addressed as git cl upload prevents me from doing it.

https://codereview.chromium.org/1559053002/diff/40001/runtime/bin/eventhandle...
File runtime/bin/eventhandler_openbsd.cc (right):

https://codereview.chromium.org/1559053002/diff/40001/runtime/bin/eventhandle...
runtime/bin/eventhandler_openbsd.cc:9: #include "bin/eventhandler_openbsd.h"
On 2016/01/11 23:58:40, Ivan Posva wrote:
> This line is not needed as eventhandler.h will include eventhandler_openbsd.h.
I
> will fix the original files.

I can't address this issue as git cl upload prevents me from uploading:
/home/mulander/github.com/mulander/sdk/runtime/bin/eventhandler_openbsd.cc:5: 
runtime/bin/eventhandler_openbsd.cc should include its header file
runtime/bin/eventhandler_openbsd.h  [bui$
d/include] [5]
/home/mulander/github.com/mulander/sdk/runtime/bin/thread_openbsd.cc:5: 
runtime/bin/thread_openbsd.cc should include its header file
runtime/bin/thread_openbsd.h  [build/include] [5]

Powered by Google App Engine
This is Rietveld 408576698