Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rizin, bump version #6922

Merged
merged 1 commit into from May 15, 2022
Merged

rizin, bump version #6922

merged 1 commit into from May 15, 2022

Conversation

Begasus
Copy link
Contributor

@Begasus Begasus commented May 14, 2022

No description provided.

@Begasus
Copy link
Contributor Author

Begasus commented May 14, 2022

Needed to bump cutter to the latest version ...

@Begasus Begasus mentioned this pull request May 15, 2022
@Begasus Begasus merged commit 65c5bcf into haikuports:master May 15, 2022
@Begasus Begasus deleted the rizin branch May 17, 2022 08:06
@XVilka
Copy link

XVilka commented Sep 29, 2022

@Begasus
Copy link
Contributor Author

Begasus commented Sep 29, 2022

Thanks @XVilka will try to make some time in the next days to check this out!

@XVilka
Copy link

XVilka commented Feb 23, 2023

@Begasus new versions of Rizin and Cutter are out with significant memory, performance, and analysis improvements:

@Begasus
Copy link
Contributor Author

Begasus commented Feb 23, 2023

Hi @XVilka although I'm able to build the latest rizin releases, the detection on Haiku for it (for Cutter) has been lacking, should get into it again and will report back when I have more info. Thanks for the heads-up!

@Begasus
Copy link
Contributor Author

Begasus commented Feb 26, 2023

@XVilka updated my build for rizin to 0.5.1, but cutter still isn't able to find it? (not sure why this is happening, there is no FindRizin.cmake anymore as I already found out.

Building ...
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /boot/system/bin/x86/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /boot/system/bin/x86/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /boot/system/lib/x86/cmake/rz_core/rz_coreConfig.cmake:35 (find_library):
  Could not find rz_core_LIBRARY using the following names: rz_core
Call Stack (most recent call first):
  /boot/system/lib/x86/cmake/Rizin/RizinConfig.cmake:96 (find_package)
  CMakeLists.txt:77 (find_package)


-- Configuring incomplete, errors occurred!

@Begasus
Copy link
Contributor Author

Begasus commented Feb 27, 2023

Thanks, noticed that, but I can't seem to find why it's failing to detect it on Haiku, in the meantime I pushed a recipe for rizin on my profile, maybe you could have a look there, but I can't find the problem so far. :/

Begasus@659e907

Adding an image that shows the lines mentioned in the error:

rizin-cutter-detection

@XVilka
Copy link

XVilka commented Mar 27, 2023

@ret2libc @thestr4ng3r do you have any idea about the possible cause?

@ret2libc
Copy link

Where did you install Rizin? Did you install the libraries in a dir available to the system (e.g. /usr/lib)?

@Begasus
Copy link
Contributor Author

Begasus commented Mar 27, 2023

--libdir=$libDir \

On 64bit this is the same as $prefix/lib, on 32bit this is the same as $prefix/lib/x86

Haiku is using a different system layout then Linux's do, $prefix is /boot/system (unlike /usr on Linux's)

So $prefix/lib is actually /boot/system/lib

EDIT just checkout a build for rizin-0.5.2 (build and install looks OK) and cutter-2.2.0, still the same error.

EDIT2 adding a log file (can't see anything wrong there, but that's me maybe) :)
O7PF4.txt

@Begasus
Copy link
Contributor Author

Begasus commented May 22, 2023

Still nogo here, @XVilka is there any fall-back to let cutter detect rizin with pkgconfig?

@XVilka
Copy link

XVilka commented May 22, 2023

@Begasus I think CMake itself should have a fallback for that. @ret2libc could you please take a look again?

BTW, we made a minor bugfix release of Cutter few days ago: https://github.com/rizinorg/cutter/releases/tag/v2.2.1

@Begasus
Copy link
Contributor Author

Begasus commented May 22, 2023

Already checking with cutterr v2.2.1 :)

@Begasus
Copy link
Contributor Author

Begasus commented May 22, 2023

Terminal output when launching a build with -L option for cmake:

waiting for build package cutter_x86-2.2.1-1 to be activated
Building ...
CMake Error at /boot/system/lib/x86/cmake/rz_core/rz_coreConfig.cmake:35 (find_library):
  Could not find rz_core_LIBRARY using the following names: rz_core
Call Stack (most recent call first):
  /boot/system/lib/x86/cmake/Rizin/RizinConfig.cmake:96 (find_package)
  CMakeLists.txt:77 (find_package)


-- Configuring incomplete, errors occurred!
See also "/sources/cutter-2.2.1/build/CMakeFiles/CMakeOutput.log".
-- Cache values
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_INSTALL_PREFIX:PATH=/packages/cutter_x86-2.2.1-1/.self
CUTTER_APPIMAGE_BUILD:BOOL=OFF
CUTTER_ENABLE_DEPENDENCY_DOWNLOADS:BOOL=OFF
CUTTER_ENABLE_GRAPHVIZ:STRING=AUTO
CUTTER_ENABLE_KSYNTAXHIGHLIGHTING:STRING=AUTO
CUTTER_ENABLE_PACKAGING:BOOL=OFF
CUTTER_ENABLE_PYTHON:BOOL=ON
CUTTER_ENABLE_PYTHON_BINDINGS:BOOL=OFF
CUTTER_ENABLE_SIGDB:BOOL=OFF
CUTTER_EXTRA_PLUGIN_DIRS:STRING=
CUTTER_INSTALL_CONFIGDIR:PATH=lib/x86/cmake/Cutter
CUTTER_INSTALL_DATADIR:PATH=data/rizin/cutter
CUTTER_PACKAGE_DEPENDENCIES:BOOL=OFF
CUTTER_PACKAGE_JSDEC:BOOL=OFF
CUTTER_PACKAGE_RZ_GHIDRA:BOOL=OFF
CUTTER_PACKAGE_RZ_LIBSWIFT:BOOL=OFF
CUTTER_PACKAGE_RZ_LIBYARA:BOOL=OFF
CUTTER_QT6:BOOL=OFF
CUTTER_USE_ADDITIONAL_RIZIN_PATHS:BOOL=OFF
CUTTER_USE_BUNDLED_RIZIN:BOOL=OFF
Rizin_DIR:PATH=/boot/system/lib/x86/cmake/Rizin
SHIBOKEN_EXTRA_OPTIONS:STRING=
rz_core_DIR:PATH=/boot/system/lib/x86/cmake/rz_core
rz_core_LIBRARY:FILEPATH=rz_core_LIBRARY-NOTFOUND
Warning: Command '['bash', '-c', '. /wrapper-script']' returned non-zero exit status 1.
keeping chroot folder /boot/home/haikuports/dev-util/cutter/work-x86-2.2.1 intact for inspection
Error: Build has failed - stopping.

@Begasus
Copy link
Contributor Author

Begasus commented May 22, 2023

Just did a check with rz-ghidra v0.5.0 with the same error not finding rizin ...

[x86] ~/wip/rz-ghidra-0.5.0> cmake -Bbuild -S. -DCMAKE_INSTALL_PREFIX=/boot/home/destdir -L
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /boot/system/bin/x86/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /boot/system/bin/x86/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /boot/system/lib/x86/cmake/rz_core/rz_coreConfig.cmake:35 (find_library):
  Could not find rz_core_LIBRARY using the following names: rz_core
Call Stack (most recent call first):
  /boot/system/lib/x86/cmake/Rizin/RizinConfig.cmake:96 (find_package)
  CMakeLists.txt:8 (find_package)


-- Configuring incomplete, errors occurred!
See also "/boot/home/wip/rz-ghidra-0.5.0/build/CMakeFiles/CMakeOutput.log".
-- Cache values
CMAKE_BUILD_TYPE:STRING=
CMAKE_INSTALL_PREFIX:PATH=/boot/home/destdir
Rizin_DIR:PATH=/boot/system/lib/x86/cmake/Rizin
rz_core_DIR:PATH=/boot/system/lib/x86/cmake/rz_core
rz_core_LIBRARY:FILEPATH=rz_core_LIBRARY-NOTFOUND

@XVilka
Copy link

XVilka commented May 22, 2023

I wonder if this could be related to rizinorg/rizin#2102

@Begasus
Copy link
Contributor Author

Begasus commented May 22, 2023

Content from rz_coreConfig.cmake:

################################################################################
#
# This module provides the following imported targets, if found:
#
#  rz_core::rz_core
#
# This file is intended to be consumed by clients who wish to use rz_core from CMake.
# The recommended way to use find this module is using `find_package(Rizin COMPONENTS ...)`.
#
# Provides the following variables
# rz_core_FOUND        - Flag for indicating that rz_core package has been found
# rz_core_VERSION      - Version of rz_core
# rz_core_INCLUDE_DIRS - Directories to include
# rz_core_LIBRARY      - Path to the single library that this module represents, without dependencies
# rz_core_LIBRARIES    - Libraries to link
# rz_core_LIBRARY_DIRS - Library directories to search for link libraries
# rz_core_PLUGINDIR    - Directory where plugins are placed, without the prefix part
#
################################################################################

set(RIZIN_MODULE_PREFIXED rz_core)
set(rz_core_VERSION 0.5.2)

get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../.." ABSOLUTE)

macro(set_and_check _var _file)
  set(${_var} "${_file}")
  if(NOT EXISTS "${_file}")
    message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
  endif()
endmacro()

set(rz_core_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/develop/headers/x86/librz" "${PACKAGE_PREFIX_DIR}/develop/headers/x86/librz/sdb")
set_and_check(rz_core_LIBRARY_DIRS "${PACKAGE_PREFIX_DIR}/lib/x86")
find_library(rz_core_LIBRARY NAMES rz_core HINTS "${rz_core_LIBRARY_DIRS}" NO_DEFAULT_PATH REQUIRED)
set(rz_core_LIBRARIES "${rz_core_LIBRARY}")
set(_rz_core_DEPENDENCIES rz_magic rz_util rz_demangler rz_diff rz_reg rz_syscall rz_search rz_cons rz_analysis rz_socket rz_type rz_io rz_lang rz_hash rz_flag rz_parse rz_egg rz_debug rz_crypto rz_config rz_bin rz_asm rz_bp rz_sign rz_il)
set(rz_core_PLUGINDIR lib/x86/rizin/plugins)

include(CMakeFindDependencyMacro)
get_filename_component(_rizin_cmake_path "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
set(_rz_core_DEPENDENCY_TARGETS)
foreach(_module_dep ${_rz_core_DEPENDENCIES})
  if (NOT ${_module_dep}_FOUND)
    find_dependency(${_module_dep} PATHS ${_rizin_cmake_path} NO_DEFAULT_PATH)
  endif()

  if (NOT ${_module_dep}_FOUND)
    set(rz_core_FOUND False)
    return()
  endif()

  list(APPEND rz_core_INCLUDE_DIRS "${${_module_dep}_INCLUDE_DIRS}")
  list(APPEND rz_core_LIBRARIES "${${_module_dep}_LIBRARIES}")
  list(APPEND _rz_core_DEPENDENCY_TARGETS "${_module_dep}::${_module_dep}")
endforeach()

list(REMOVE_DUPLICATES rz_core_INCLUDE_DIRS)
list(REMOVE_DUPLICATES rz_core_LIBRARIES)

if(NOT TARGET rz_core::rz_core)
  add_library(rz_core::rz_core SHARED IMPORTED)
  target_link_libraries(rz_core::rz_core INTERFACE ${_rz_core_DEPENDENCY_TARGETS})
  set_target_properties(rz_core::rz_core PROPERTIES
    INTERFACE_INCLUDE_DIRECTORIES "${rz_core_INCLUDE_DIRS}")
  set_target_properties(rz_core::rz_core PROPERTIES
    IMPORTED_LOCATION "${rz_core_LIBRARY}")
endif()
set(rz_core_TARGET rz_core::rz_core)

@Begasus
Copy link
Contributor Author

Begasus commented May 22, 2023

pkgconfig output for rz_core:

~/Desktop> pkg-config-x86 rz_core --libs
-L/packages/rizin_x86-0.5.2-1/.self/develop/lib/x86 -lrz_core -lrz_demangler -lrz_lang -lrz_debug -lrz_egg -lrz_bp -lrz_sign -lrz_analysis -lrz_asm -lrz_config -lrz_parse -lrz_bin -lrz_magic -lrz_io -lrz_crypto -lrz_cons -lrz_socket -lrz_syscall -lrz_diff -lrz_hash -lrz_type -lrz_search -lrz_flag -lrz_il -lrz_reg -lrz_util

~/Desktop> pkg-config-x86 rz_core --cflags
-I/packages/rizin_x86-0.5.2-1/.self/develop/headers/x86/librz -I/packages/capstone_x86-4.0.2-2/.self/develop/headers/x86/capstone/ -I/packages/rizin_x86-0.5.2-1/.self/develop/headers/x86/librz -I/packages/lz4_x86-1.9.3-2/.self/develop/headers/x86 -I/packages/rizin_x86-0.5.2-1/.self/develop/headers/x86/librz -I/packages/libzip_x86-1.9.2-1/.self/develop/headers/x86 -I/packages/rizin_x86-0.5.2-1/.self/develop/headers/x86/librz -I/packages/xxhash_x86-0.8.1~git-2/.self/develop/headers/x86 -I/packages/rizin_x86-0.5.2-1/.self/develop/headers/x86/librz -I/packages/tree_sitter_x86-0.20.6-7/.self/develop/headers/x86 -I/packages/rizin_x86-0.5.2-1/.self/develop/headers/x86/librz -I/packages/rizin_x86-0.5.2-1/.self/develop/headers/x86/librz/sdb -I/packages/zlib_x86-1.2.13-2/.self/develop/headers/x86 -I/packages/openssl_x86-1.1.1t-1/.self/develop/headers/x86

@Begasus
Copy link
Contributor Author

Begasus commented May 22, 2023

I wonder if this could be related to rizinorg/rizin#2102

Our current version (v0.3.4) was released after the temporary "workaround", so I doubt it would?

EDIT current cutter (v2.0.5) in our repository still finds rizin v0.5.2 fine.

EDIT2 build fails thought (expected) with the newer rizin version :)

EDIT3 fall-back to using FindRizin.cmake from v2.0.5 helps getting rizin v0.5.2 to find it's headers/libraries.
Build errors on linking the executible now:

[100%] Building CXX object src/CMakeFiles/Cutter.dir/Cutter_autogen/NWLCJBWTY4/qrc_light.cpp.o
[100%] Linking CXX executable ../cutter
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: CMakeFiles/Cutter.dir/core/Cutter.cpp.o: in function `CutterCore::applySignature(QString const&)':
Cutter.cpp:(.text+0x4f77): undefined reference to `rz_sign_flirt_apply'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: CMakeFiles/Cutter.dir/core/Cutter.cpp.o:(.data+0x7c): undefined reference to `rz_sign_version'
collect2: error: ld returned 1 exit status
src/CMakeFiles/Cutter.dir/build.make:2884: recipe for target 'cutter' failed

@ret2libc
Copy link

Were you able to compile Cutter 2.2.1 with Rizin 0.5.2?

@XVilka
Copy link

XVilka commented May 23, 2023

Maybe you could copy old FindRizin.cmake to the newer Cutter 2.2.1 as a temporary workaround?

@Begasus
Copy link
Contributor Author

Begasus commented May 23, 2023

Were you able to compile Cutter 2.2.1 with Rizin 0.5.2?

Yes, but got as far as the linking error mentioned above.

Maybe you could copy old FindRizin.cmake to the newer Cutter 2.2.1 as a temporary workaround?

That's what I did, ended up in the linking error.

EDIT Doing a check on something else atm, will create the patch (including the older FindRizin.cmake and a small revert in the CMakeLists.txt) and push the changes to a new branch.

@XVilka
Copy link

XVilka commented May 23, 2023

Maybe you could copy old FindRizin.cmake to the newer Cutter 2.2.1 as a temporary workaround?

That's what I did, ended up in the linking error.

It's because it missed the rz_sign module, try adding sign in the Rizin_LIBRARY_NAMES in FindRizin.cmake, that should do the trick.

@Begasus
Copy link
Contributor Author

Begasus commented May 23, 2023

Worked!!! Thanks guys! 🥇

Cutter-2-2-1

@XVilka
Copy link

XVilka commented May 23, 2023

By the way, since I noticed you use localized version, all translations are managed at the Crowdin service:

@Begasus
Copy link
Contributor Author

Begasus commented May 23, 2023

By the way, since I noticed you use localized version, all translations are managed at the Crowdin service:

* https://crowdin.com/project/cutter

* https://github.com/rizinorg/cutter-translations

Using the latest commit on the cutter-translations for cutter already (seems some missing strings there for Dutch) :)

@XVilka
Copy link

XVilka commented May 23, 2023

Yes, it says 50% translated only.

@Begasus
Copy link
Contributor Author

Begasus commented May 23, 2023

Maybe something when I get around to it, not sure I know enough details when it comes to technical terminology, but could give it a try to update some strings there. :)

@Begasus
Copy link
Contributor Author

Begasus commented May 23, 2023

Latest rizin bumped in: #8712
Latest cutter bumped in: #8713

@XVilka
Copy link

XVilka commented Mar 5, 2024

Hi, just to let you know, Rizin 0.7.1 version was released with many quality of life changes, along with corresponding Cutter 2.3.4 release:

@Begasus
Copy link
Contributor Author

Begasus commented Mar 5, 2024

Thanks @XVilka will take a tour on it today :)

@Begasus
Copy link
Contributor Author

Begasus commented Mar 9, 2024

@XVilka bumped Rizin to 0.7.2 and Cutter 2.3.4 today, thanks for the heads-up, still have to patch Cutter though to fix detection for Rizin (issue still open).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants