Skip to content

Commit 3c53a64

Browse files
committed
Merge branch 'dev'
2 parents 896416b + e6da816 commit 3c53a64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1349
-667
lines changed

.github/workflows/PyPI-publishing.yml

+10
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ jobs:
4646
python-ver: '3.8',
4747
name: 'manylinux2014_i686'
4848
}
49+
- {
50+
os: ubuntu-latest,
51+
arch: aarch64,
52+
python-ver: '3.8',
53+
name: 'manylinux2014_aarch64'
54+
}
4955
- {
5056
os: ubuntu-latest,
5157
arch: x64,
@@ -104,6 +110,10 @@ jobs:
104110
docker run --rm -v `pwd`/:/work dockcross/manylinux2014-x86 > ./dockcross
105111
chmod +x ./dockcross
106112
./dockcross bindings/python/build_wheel.sh
113+
elif [ ${{ matrix.config.name }} == 'manylinux2014_aarch64' ]; then
114+
docker run --rm -v `pwd`/:/work dockcross/manylinux2014-aarch64 > ./dockcross
115+
chmod +x ./dockcross
116+
./dockcross bindings/python/build_wheel.sh --plat-name manylinux2014_aarch64
107117
elif [ ${{ matrix.config.name }} == 'manylinux2014_x86_64' ]; then
108118
docker run --rm -v `pwd`/:/work dockcross/manylinux2014-x64 > ./dockcross
109119
chmod +x ./dockcross

.github/workflows/build-uc2.yml

+31-31
Original file line numberDiff line numberDiff line change
@@ -54,34 +54,34 @@ jobs:
5454
archiver: '7z a',
5555
generators: 'Ninja'
5656
}
57-
- {
58-
os: windows-2019,
59-
arch: x64,
60-
python-arch: x64,
61-
python-ver: '3.8',
62-
name: 'windows-x64 MINGW32 shared',
63-
shared: "yes",
64-
mingw: MINGW32,
65-
mingw-arch: i686,
66-
artifact: 'windows_mingw32.7z',
67-
build_type: 'Debug',
68-
archiver: '7z a',
69-
generators: 'Ninja'
70-
}
71-
- {
72-
os: windows-2019,
73-
arch: x64,
74-
python-arch: x64,
75-
python-ver: '3.8',
76-
name: 'windows-x64 MINGW32 static',
77-
shared: "no",
78-
mingw: MINGW32,
79-
mingw-arch: i686,
80-
artifact: 'windows_mingw32.7z',
81-
build_type: 'Debug',
82-
archiver: '7z a',
83-
generators: 'Ninja'
84-
}
57+
# - { # This fails randomly which can't be reproduced.
58+
# os: windows-2019,
59+
# arch: x64,
60+
# python-arch: x64,
61+
# python-ver: '3.8',
62+
# name: 'windows-x64 MINGW32 shared',
63+
# shared: "yes",
64+
# mingw: MINGW32,
65+
# mingw-arch: i686,
66+
# artifact: 'windows_mingw32.7z',
67+
# build_type: 'Debug',
68+
# archiver: '7z a',
69+
# generators: 'Ninja'
70+
# }
71+
# - { # This fails randomly which can't be reproduced.
72+
# os: windows-2019,
73+
# arch: x64,
74+
# python-arch: x64,
75+
# python-ver: '3.8',
76+
# name: 'windows-x64 MINGW32 static',
77+
# shared: "no",
78+
# mingw: MINGW32,
79+
# mingw-arch: i686,
80+
# artifact: 'windows_mingw32.7z',
81+
# build_type: 'Debug',
82+
# archiver: '7z a',
83+
# generators: 'Ninja'
84+
# }
8585
- {
8686
os: windows-2019,
8787
arch: x64,
@@ -95,7 +95,7 @@ jobs:
9595
archiver: '7z a',
9696
generators: 'Visual Studio 16 2019'
9797
}
98-
- {
98+
- {
9999
os: windows-2019,
100100
arch: x86,
101101
python-arch: x86,
@@ -328,9 +328,9 @@ jobs:
328328
brew install p7zip cmake ninja
329329
mkdir build
330330
mkdir instdir
331-
cmake . -DCMAKE_TOOLCHAIN_FILE="$ANDROID_HOME/ndk/21.4.7075529/build/cmake/android.toolchain.cmake" \
331+
cmake . -DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK/build/cmake/android.toolchain.cmake" \
332332
-DANDROID_PLATFORM=android-28 \
333-
-DANDROID_NDK="$ANDROID_HOME/ndk/21.4.7075529" \
333+
-DANDROID_NDK="$ANDROID_NDK" \
334334
-DANDROID_ABI=${{ matrix.config.arch }} \
335335
-DOLP_SDK_ENABLE_TESTING=NO \
336336
-DOLP_SDK_BUILD_EXAMPLES=ON \

.github/workflows/stale.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ jobs:
1414
days-before-stale: 60
1515
days-before-close: 15
1616
exempt-all-milestones: true
17-
exempt-issue-labels: 'pinned'
17+
exempt-issue-labels: 'pinned,help wanted'
1818
exempt-pr-labels: 'pinned'

CMakeLists.txt

+25-10
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33

44
cmake_minimum_required(VERSION 3.1)
55

6-
if(MSVC)
7-
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.15")
8-
# set all policies to max supported by actual running cmake version
9-
# mainly want the following:
10-
# CMP0091: prevent msvcrt flags being added to default CMAKE_<LANG>_FLAGS_<CONFIG>
11-
# CMP0092: prevent warning flags being added to default CMAKE_<LANG>_FLAGS
12-
cmake_policy(VERSION ${CMAKE_VERSION})
13-
else()
14-
message(FATAL_ERROR "please update cmake")
15-
endif()
6+
# Only required for MSVC, but we can't know the compiler at this point because we haven't
7+
# called enable_language() or project(), and if we did that it would lock in the old
8+
# policy. Setting these policies is harmless for non-MSVC though, so just enable them
9+
# always.
10+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.15")
11+
# Set explicitly the policies we want rather than raising the base to the current
12+
# version. This prevents unintended behavior changes as CMake evolves and provides a
13+
# consistent experience across different CMake versions.
14+
# CMP0091: prevent msvcrt flags being added to default CMAKE_<LANG>_FLAGS_<CONFIG>
15+
cmake_policy(SET CMP0091 NEW)
16+
# CMP0092: prevent warning flags being added to default CMAKE_<LANG>_FLAGS for MSVC
17+
cmake_policy(SET CMP0092 NEW)
1618
endif()
1719

1820
# Workaround to fix wrong compiler on macos.
@@ -31,6 +33,13 @@ endif()
3133

3234
project(unicorn C)
3335

36+
# We depend on the availability of the CMAKE_MSVC_RUNTIME_LIBRARY, which is only
37+
# available in CMake 3.15 and above (see also the comments above in regards to policy
38+
# CMP0091).
39+
if(MSVC AND CMAKE_VERSION VERSION_LESS "3.15")
40+
message(FATAL_ERROR "Please update CMake to 3.15 or greater.")
41+
endif()
42+
3443
# mainline qemu mostly just uses compiler default
3544
set(CMAKE_C_STANDARD 11)
3645

@@ -1403,6 +1412,9 @@ if(UNICORN_BUILD_TESTS)
14031412
add_executable(${TEST_FILE}
14041413
${CMAKE_CURRENT_SOURCE_DIR}/tests/unit/${TEST_FILE}.c
14051414
)
1415+
target_compile_options(${TEST_FILE} PRIVATE
1416+
${UNICORN_COMPILE_OPTIONS}
1417+
)
14061418
target_link_libraries(${TEST_FILE} PRIVATE
14071419
${SAMPLES_LIB}
14081420
)
@@ -1412,6 +1424,9 @@ if(UNICORN_BUILD_TESTS)
14121424
file(APPEND ${CMAKE_BINARY_DIR}/adb.sh "adb shell \"chmod +x /data/local/tmp/build/${TEST_FILE}\"\n")
14131425
file(APPEND ${CMAKE_BINARY_DIR}/adb.sh "adb shell \'LD_LIBRARY_PATH=/data/local/tmp/build:$LD_LIBRARY_PATH /data/local/tmp/build/${TEST_FILE}\' || exit -1\n")
14141426
endif()
1427+
if (UNICORN_TARGET_ARCH STREQUAL "aarch64" OR UNICORN_TARGET_ARCH STREQUAL "ppc")
1428+
target_compile_definitions(${TEST_FILE} PRIVATE TARGET_READ_INLINED)
1429+
endif()
14151430
endforeach()
14161431
endif()
14171432

ChangeLog

+38
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
This file details the changelog of Unicorn Engine.
22

3+
-------------------------------
4+
[Version 2.0.1]: Nov 1st, 2022
5+
6+
Unicorn2 makes the first step to [Debian packages](https://tracker.debian.org/pkg/unicorn-engine) and [vcpkg](https://github.com/microsoft/vcpkg/pull/26101)! Thanks @roehling and @LilyWangL !
7+
8+
Features:
9+
10+
- Support building & running on BE hosts. #1710
11+
- Fix and support `clang-cl` on Windows. #1687
12+
- Fix python `sdist` and add aarch64 Linux wheels. Note `pip` can build Unicorn2 on M1 now!
13+
- C# binding is refined and upgraded to .Net 6. #1723
14+
15+
Fix/Improvements:
16+
17+
- Various bindings improvements. #1723
18+
- Improvements for tests. #1684 #1683 #1691 #1711
19+
- Fail explicitly when VEX.L is set. #1658
20+
- Fix endianness when writing PPC32 CR register. #1659
21+
- Fix a bug in `uc_ctl_set_cpu_model` check.
22+
- Fix Tricore PC not updating. #1668
23+
- Fix the mapping not updated if users modify the mappings in the hooks.
24+
- Handle pathological cases consistently. #1651
25+
- Fix memory leaks in PPC target. #1680
26+
- Fix memory leaks in Tricore target. #1681
27+
- Fix MSVC handling in cmake. #1693
28+
- Fix PC sync-ing problems for `UC_HOOK_BLOCK` hooks.
29+
- Fix PC sync-ed twice when users request a soft restart.
30+
- Prevent overflow with pre-allocated RAM blocks. #1712
31+
- Add FPCR and FPSR registers #1722
32+
- Fix ARM CPU state not deep copied.
33+
- Fix PC not sync-ed for memory operation on aarch64.
34+
- Exit invalid store operations early to avoid the target registers being overwritten.
35+
- Improve the support for ARM BE32.
36+
37+
Thanks:
38+
39+
@roehling @LilyWangL @mrexodia @zachriggle @Yu3H0 @rhelmot @relapids @sh4w1 @TSRBerry
40+
341
-------------------------------
442
[Version 2.0.0]: July 7th, 2022
543

bindings/dotnet/README.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@ from source.
77

88
1. Compile the code
99

10-
[Windows]
11-
To compile the code open the UnicornSln.sln with Microsoft Visual
12-
Studio 12 or with a newer version and just press Ctrl+Shift+B to build
13-
the solution.
14-
15-
You need to have installed at least version 4.5 of the .NET framework.
16-
17-
[Linux]
18-
TODO
10+
You need to have at least version 5.0 of .NET installed.
11+
12+
1. Windows
13+
14+
To compile the code open the UnicornSln.sln with Microsoft Visual
15+
Studio 12 or with a newer version and just press Ctrl+Shift+B to build
16+
the solution.
17+
18+
2. Linux
19+
20+
To compile the code open a terminal in this directory
21+
and enter the following command to build the solution:
22+
`dotnet build`
1923

2024
2. Usage
2125

bindings/dotnet/UnicornManaged/AssemblyInfo.fs

-41
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
namespace UnicornManaged.Binding
22

3-
open System
43

54
module BindingFactory =
65
let mutable _instance = NativeBinding.instance
76

87
let setDefaultBinding(binding: IBinding) =
98
_instance <- binding
10-
9+
1110
let getDefault() =
1211
_instance
13-

bindings/dotnet/UnicornManaged/Const/Arm64.fs

+5-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,11 @@ module Arm64 =
318318
let UC_ARM64_REG_VBAR_EL2 = 288
319319
let UC_ARM64_REG_VBAR_EL3 = 289
320320
let UC_ARM64_REG_CP_REG = 290
321-
let UC_ARM64_REG_ENDING = 291
321+
322+
// floating point control and status registers
323+
let UC_ARM64_REG_FPCR = 291
324+
let UC_ARM64_REG_FPSR = 292
325+
let UC_ARM64_REG_ENDING = 293
322326

323327
// alias registers
324328
let UC_ARM64_REG_IP0 = 215

0 commit comments

Comments
 (0)