Commit Graph

12 Commits

Author SHA1 Message Date
Zach Anderson f407419d0a [vm] Reland: Prefix HOST_OS_* and TARGET_OS_* with DART_
This relands https://dart-review.googlesource.com/c/sdk/+/205633
but without renaming TARGET_OS_IPHONE to DART_TARGET_OS_IPHONE.
It also changes uses of TARGET_OS_IOS to
DART_TARGET_OS_MACOS_IOS to be consistent with the rest of the
VM.

TargetConditionals.h for XCode 13 defines several
TARGET_OS_* preprocessor symbols that confuse the
Dart build. There is probably a more targeted fix
for this, but renaming the symbols that Dart uses
will also prevent this problem if more symbols
are added to the platform headers in the future.

See: https://github.com/dart-lang/sdk/issues/46499

TEST=It builds.

Change-Id: Ie775c19dd23cfdf5f65e5ebc6ee4ec3a561676fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205860
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-07-02 19:06:45 +00:00
Slava Egorov 42164cc140 Revert "[vm] Prefix HOST_OS_* and TARGET_OS_* with DART_"
This reverts commit aa9201b76b.

Reason for revert: blocks G3 roll (b/192627187)

Original change's description:
> [vm] Prefix HOST_OS_* and TARGET_OS_* with DART_
>
> TargetConditionals.h for XCode 13 defines several
> TARGET_OS_* preprocessor symbols that confuse the
> Dart build. There is probably a more targeted fix
> for this, but renaming the symbols that Dart uses
> will also prevent this problem if more symbols
> are added to the platform headers in the future.
>
> See: https://github.com/dart-lang/sdk/issues/46499
>
> TEST=It builds.
> Change-Id: I3b33a03b4a9a14b76d55fe12f8cdefec4b3c3664
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205633
> Commit-Queue: Zach Anderson <zra@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=rmacnak@google.com,zra@google.com,asiva@google.com

Change-Id: Ib06ca418c7e9d3b4df62c72c033cd39f462f7667
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205790
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2021-07-02 14:02:02 +00:00
Zach Anderson aa9201b76b [vm] Prefix HOST_OS_* and TARGET_OS_* with DART_
TargetConditionals.h for XCode 13 defines several
TARGET_OS_* preprocessor symbols that confuse the
Dart build. There is probably a more targeted fix
for this, but renaming the symbols that Dart uses
will also prevent this problem if more symbols
are added to the platform headers in the future.

See: https://github.com/dart-lang/sdk/issues/46499

TEST=It builds.
Change-Id: I3b33a03b4a9a14b76d55fe12f8cdefec4b3c3664
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205633
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-07-02 06:02:48 +00:00
Alexander Aprelev 20eb34f233 [vm/win/crypto] Cleanup use of BCryptGenRandom.
This is follow-up to https://dart.googlesource.com/sdk/+/1731050b29097b7b40d208ec1658f6f20737d276

TEST=ci

Change-Id: I682702addf50a1bf93fecbf1e1f835801c6c7f20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202727
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-06-07 23:15:13 +00:00
bdbai 1731050b29 Use BCryptGenRandom for Crypto::GetRandomBytes on Windows
The current implementation of Crypto::GetRandomBytes on Windows calls
`rand_s` repeatedly until the buffer is completely filled. However,
`BCryptGenRandom` already provides the similar functionality to fill the
whole buffer at once and thus there is no need to maintain a handcrafted
implementation any more.

TEST=ci

Change-Id: I52d990b01b59be872d825f2aa0e30b500a6d3e36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200160
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-05-26 01:55:11 +00:00
Ryan Macnak 877284947b Rename TARGET_OS_* to HOST_OS_*.
Like HOST_ARCH_*, HOST_OS_* describes the OS the VM is running on, which may be different from the OS the VM is generating code for during AOT compilation.

Currently we conflate the two when emitting AOT as assembly, and we get away with it because Flutter only uses assembly for targeting iOS and one can only target iOS from a Mac, but we expect to use assembly for Android as well so native tools can unwind Dart frames.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2750843003 .
2017-03-15 13:11:05 -07:00
Zachary Anderson c75a817ee0 Fixes some memory leaks in //runtime/bin
Also some style cleanups.

Decided to fix these leaks by using Dart_ScopeAllocate
instead of malloc and new. Leaks are noted in the CL.

I haven't finished looking over all the code in
//runtime/bin yet, but this CL was getting big.

Review URL: https://codereview.chromium.org/1781883002 .
2016-03-14 11:08:52 -07:00
asiva@google.com 2761153e08 Fix following compiler warnings:
os_win.cc(266) : warning C4018: '>=' : signed/unsigned mismatch
stub_code_ia32.cc(89) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
stub_code_ia32.cc(213) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
stub_code_ia32.cc(317) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
crypto_win.cc(5) : warning C4005: '_CRT_RAND_S' : macro redefinition
file_win.cc(512) : warning C4101: 'st' : unreferenced local variable

BUG=http://dartbug.com/21150
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//619723004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40826 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 23:29:26 +00:00
smok@google.com ebbc2020a2 Put everything in runtime/bin into '::dart::bin' namespace.
Review URL: https://codereview.chromium.org//14341015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22032 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-25 14:22:30 +00:00
iposva@google.com b1c855488b - Attempt to fix build breakage on Windows.
Review URL: https://codereview.chromium.org//12319030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18788 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-20 21:27:07 +00:00
iposva@google.com 9046a44a37 Prepare for removal of source_filter.gypi:
- Guard OS-dependent source files with #if TARGET_OS_* in a similar
  fashion to the architecture dependent sources.
Review URL: https://codereview.chromium.org//12282051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18786 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-20 21:17:38 +00:00
ajohnsen@google.com 0ef4ef2f84 Add sessions to HttpServer.
A session is started when HttpRequest.getSession() is called. The
session will then be added to the session manager. The session manager
then controls timeouts.

The session id is create by using the a crypto-random sequence of 16
bytes. These are extracted by using /dev/urandom on posix and
CryptGenRandom on windows.

BUG=

Review URL: https://codereview.chromium.org//11175030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13870 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-22 13:08:42 +00:00