GithubHelp home page GithubHelp logo

aur's Introduction

Hi there (from the future) ๐Ÿ‘‹

View all my projects that I am maintaining: https://github.com/sickcodes/

View CVEs, advisories, and erroneous releases: https://github.com/sickcodes/security

View the main site: https://sick.codes

Follow me on Twitter: https://twitter.com/sickcodes

Connect with me on Linkedin (business) https://www.linkedin.com/in/sickcodes/

View my YouTube tutorials https://www.youtube.com/c/sickcodes

Join my Discord: https://discord.com/invite/sickcodeschat

Join my Telegram: https://t.me/sickcodeschat

Working on https://automatedsecurityresearch.com/

But most of all, feel free to get in touch! https://sick.codes/contact/ or info (at) sick.codes

Good vibes, good code, good times only will be stricly enforced! :)

aur's People

Contributors

cniw avatar fabiololix avatar leandro-benedet-garcia avatar realqhc avatar sickcodes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aur's Issues

`riscv-gnu-toolchain` fails to compile simple test program (CMake Cross Compiler)

The toolchain has seemingly been configured incorrectly. Observe the following output from CMake:

[quaker@threadripper build]$ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain/riscv_gcc.cmake ../

-- The C compiler identification is unknown
-- Check for working C compiler: /usr/bin/riscv32-unknown-elf-gcc
-- Check for working C compiler: /usr/bin/riscv32-unknown-elf-gcc - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/usr/bin/riscv32-unknown-elf-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/quaker/Programming/OSDev/qnix/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/make -f Makefile cmTC_87000/fast && /usr/bin/make  -f CMakeFiles/cmTC_87000.dir/build.make CMakeFiles/cmTC_87000.dir/build
    make[1]: Entering directory '/home/quaker/Programming/OSDev/qnix/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_87000.dir/testCCompiler.c.obj
    /usr/bin/riscv32-unknown-elf-gcc   -g3 -ggdb -v -march=rv32imad -mabi=ilp32 -g3 -ggdb -v -march=rv32imad -mabi=ilp32  -o CMakeFiles/cmTC_87000.dir/testCCompiler.c.obj -c /home/quaker/Programming/OSDev/qnix/build/CMakeFiles/CMakeTmp/testCCompiler.c
    Using built-in specs.
    COLLECT_GCC=/usr/bin/riscv32-unknown-elf-gcc
    Target: riscv32-unknown-elf
    Configured with: /home/runner/work/riscv-gnu-toolchain/riscv-gnu-toolchain/riscv-gcc/configure --target=riscv32-unknown-elf --prefix=/opt/riscv --disable-shared --disable-threads --enable-languages=c,c++ --with-system-zlib --enable-tls --with-newlib --with-sysroot=/opt/riscv/riscv32-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=.././riscv-gcc --disable-multilib --with-abi=ilp32d --with-arch=rv32gc --with-tune=rocket 'CFLAGS_FOR_TARGET=-Os   -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-Os   -mcmodel=medlow'
    Thread model: single
    Supported LTO compression algorithms: zlib
    gcc version 11.1.0 (GCC) 
    COLLECT_GCC_OPTIONS='-g3' '-ggdb' '-v' '-march=rv32imad' '-mabi=ilp32' '-g3' '-ggdb' '-v' '-march=rv32imad' '-mabi=ilp32' '-o' 'CMakeFiles/cmTC_87000.dir/testCCompiler.c.obj' '-c' '-mtune=rocket' '-march=rv32imafd' '-march=rv32imafd' '-dumpdir' 'CMakeFiles/cmTC_87000.dir/'
     /usr/bin/../libexec/gcc/riscv32-unknown-elf/11.1.0/cc1 -quiet -v -v -iprefix /usr/bin/../lib/gcc/riscv32-unknown-elf/11.1.0/ -dD /home/quaker/Programming/OSDev/qnix/build/CMakeFiles/CMakeTmp/testCCompiler.c -quiet -dumpdir CMakeFiles/cmTC_87000.dir/ -dumpbase testCCompiler.c.c -dumpbase-ext .c -march=rv32imad -mabi=ilp32 -march=rv32imad -mabi=ilp32 -mtune=rocket -march=rv32imafd -march=rv32imafd -g3 -ggdb -g3 -ggdb -version -o /tmp/cc06PTI7.s
    GNU C17 (GCC) version 11.1.0 (riscv32-unknown-elf)
        compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version none
    warning: GMP header version 6.2.0 differs from library version 6.2.1.
    warning: MPFR header version 4.0.2 differs from library version 4.1.0-p13.
    warning: MPC header version 1.1.0 differs from library version 1.2.1.
    GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
    ignoring nonexistent directory "/usr/bin/../lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include"
    ignoring duplicate directory "/usr/bin/../lib/gcc/../../lib/gcc/riscv32-unknown-elf/11.1.0/include"
    ignoring nonexistent directory "/opt/riscv/riscv32-unknown-elf/usr/local/include"
    ignoring duplicate directory "/usr/bin/../lib/gcc/../../lib/gcc/riscv32-unknown-elf/11.1.0/include-fixed"
    ignoring nonexistent directory "/usr/bin/../lib/gcc/../../lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include"
    ignoring nonexistent directory "/opt/riscv/riscv32-unknown-elf/include"
    #include "..." search starts here:
    #include <...> search starts here:
     /usr/bin/../lib/gcc/riscv32-unknown-elf/11.1.0/include
     /usr/bin/../lib/gcc/riscv32-unknown-elf/11.1.0/include-fixed
    End of search list.
    GNU C17 (GCC) version 11.1.0 (riscv32-unknown-elf)
        compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version none
    warning: GMP header version 6.2.0 differs from library version 6.2.1.
    warning: MPFR header version 4.0.2 differs from library version 4.1.0-p13.
    warning: MPC header version 1.1.0 differs from library version 1.2.1.
    GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
    Compiler executable checksum: 7308359611291ffe4021af7fc60c4c7d
    COLLECT_GCC_OPTIONS='-g3' '-ggdb' '-v' '-march=rv32imad' '-mabi=ilp32' '-g3' '-ggdb' '-v' '-march=rv32imad' '-mabi=ilp32' '-o' 'CMakeFiles/cmTC_87000.dir/testCCompiler.c.obj' '-c' '-mtune=rocket' '-march=rv32imafd' '-march=rv32imafd' '-dumpdir' 'CMakeFiles/cmTC_87000.dir/'
     as -v -v --gdwarf-5 --traditional-format -march=rv32imad -march=rv32imad -march=rv32imafd -march=rv32imafd -mabi=ilp32 -mabi=ilp32 -o CMakeFiles/cmTC_87000.dir/testCCompiler.c.obj /tmp/cc06PTI7.s
    GNU assembler version 2.38 (x86_64-pc-linux-gnu) using BFD version (GNU Binutils) 2.38
    Assembler messages:
    Fatal error: invalid -march= option: `rv32imad'
    make[1]: *** [CMakeFiles/cmTC_87000.dir/build.make:78: CMakeFiles/cmTC_87000.dir/testCCompiler.c.obj] Error 1
    make[1]: Leaving directory '/home/quaker/Programming/OSDev/qnix/build/CMakeFiles/CMakeTmp'
    make: *** [Makefile:127: cmTC_87000/fast] Error 2
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:5 (project)

It seems the compiler is invoking the host's as, which is insanity.

The command riscv32-unknown-elf-gcc --target-help also fails:

[quaker@threadripper build]$ riscv32-unknown-elf-gcc --target-help
The following options are target specific:
  -mabi=                      Specify integer and floating-point calling convention.
  -malign-data=               Use the given data alignment.
  -march=                     Generate code for given RISC-V ISA (e.g. RV64IM).  ISA strings must be lower-case.
  -mbig-endian                Assume target CPU is configured as big endian.
  -mbranch-cost=N             Set the cost of branches to roughly N instructions.
  -mcmodel=                   Specify the code model.
  -mcpu=PROCESSOR             Use architecture of and optimize the output for PROCESSOR.
  -mdiv                       Use hardware instructions for integer division.
  -mexplicit-relocs           Use %reloc() operators, rather than assembly macros, to load addresses.
  -mfdiv                      Use hardware floating-point divide and square root instructions.
  -misa-spec=                 Set the version of RISC-V ISA spec.
  -mlittle-endian             Assume target CPU is configured as little endian.
  -mplt                       When generating -fpic code, allow the use of PLTs. Ignored for fno-pic.
  -mpreferred-stack-boundary= Attempt to keep stack aligned to this power of 2.
  -mrelax                     Take advantage of linker relaxations to reduce the number of instructions required to materialize symbol addresses.
  -mriscv-attribute           Emit RISC-V ELF attribute.
  -msave-restore              Use smaller but slower prologue and epilogue code.
  -mshorten-memrefs           Convert BASE + LARGE_OFFSET addresses to NEW_BASE + SMALL_OFFSET to allow more memory accesses to be generated as compressed instructions.  Currently targets 32-bit integer load/stores.
  -msmall-data-limit=N        Put global and static data smaller than <number> bytes into a special section (on some targets).
  -mstack-protector-guard-offset= Use the given offset for addressing the stack-protector guard.
  -mstack-protector-guard-reg= Use the given base register for addressing the stack-protector guard.
  -mstack-protector-guard=    Use given stack-protector guard.
  -mstrict-align              Do not generate unaligned memory accesses.
  -mtune=PROCESSOR            Optimize the output for PROCESSOR.

  Supported ABIs (for use with the -mabi= option):
    ilp32 ilp32d ilp32e ilp32f lp64 lp64d lp64f

  Known code models (for use with the -mcmodel= option):
    medany medlow

  Supported ISA specs (for use with the -misa-spec= option):
    2.2 20190608 20191213

  Known data alignment choices (for use with the -malign-data= option):
    natural xlen

  Valid arguments to -mstack-protector-guard=:
    global tls

Assembler options
=================

Use "-Wa,OPTION" to pass "OPTION" to the assembler.

Assembler messages:
Fatal error: invalid -march= option: `rv32imafdc'

riscv-gnu-toolchain cannot compile

Hi!

it seems that the riscv-gnu-toolchain(-bin) packages are not working properly. I've encountered this in riscv-collab/riscv-gnu-toolchain#1005. The toolchain is unable to find its assembler when called via riscv32-unknown-elf-gcc. The issue seems to be that the target-specific directories shouldn't be deleted:

  rm -rf "${srcdir}"/riscv/riscv64-unknown-linux-gnu
  rm -rf "${srcdir}"/riscv/riscv32-unknown-linux-gnu
  rm -rf "${srcdir}"/riscv/riscv64-unknown-elf
  rm -rf "${srcdir}"/riscv/riscv32-unknown-elf

I think they need to be copied into /usr with the rest of the toolchain. This should fix the problem.

However, there remain some file conflicts as noted in the current PKGBUILD. I've hacked together an alternative PKGBUILD for a single toolchain variant that fixes this. It is not a drop-in replacement for either of the packages, but it should be slightly more robust - it puts all files into an isolated directory in /opt and only adds symlinks for the toolchain binaries.

# Maintainer: Sick Codes <info at sick dot codes>
#
pkgname=riscv-gnu-toolchain-bin
# To maintain, simply change the nightly date: https://github.com/riscv-collab/riscv-gnu-toolchain/releases
pkgver=2021.09.21
_target=11.1.0
_pkg_prefix=ubuntu-20.04-nightly
pkgrel=1
pkgdesc="GNU toolchain for RISC-V, including GCC. Precompiled riscv32-unknown-elf-gcc."
arch=('x86_64')
url="https://github.com/riscv-collab/riscv-gnu-toolchain"
license=('GPL2')
provides=(${pkgname}
  riscv32-unknown-elf-gcc-11.1.0 riscv32-unknown-elf-size riscv32-unknown-elf-run riscv32-unknown-elf-objdump riscv32-unknown-elf-nm riscv32-unknown-elf-gdb-add-index riscv32-unknown-elf-c++filt riscv32-unknown-elf-addr2line riscv32-unknown-elf-gcc-nm riscv32-unknown-elf-readelf riscv32-unknown-elf-lto-dump riscv32-unknown-elf-gcc riscv32-unknown-elf-ld.bfd riscv32-unknown-elf-ranlib riscv32-unknown-elf-gcov-tool riscv32-unknown-elf-ld riscv32-unknown-elf-gcc-ar riscv32-unknown-elf-gdb riscv32-unknown-elf-gcov riscv32-unknown-elf-as riscv32-unknown-elf-gcov-dump riscv32-unknown-elf-objcopy riscv32-unknown-elf-gcc-ranlib riscv32-unknown-elf-strip riscv32-unknown-elf-c++ riscv32-unknown-elf-cpp riscv32-unknown-elf-strings riscv32-unknown-elf-ar riscv32-unknown-elf-elfedit riscv32-unknown-elf-gprof riscv32-unknown-elf-g++
)
depends=()
optdepends=()
makedepends=(curl python3 mpc mpfr gmp texinfo gperf libtool patchutils bc zlib expat)
source=(
  "https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/${pkgver}/riscv32-elf-${_pkg_prefix}-${pkgver}-nightly.tar.gz"
)
# skipping shasums due to size
sha256sums=(
  'SKIP'
)

package() {

  install -dm755 "${pkgdir}"/opt/riscv32-unknown-elf
  install -dm755 "${pkgdir}"/usr/bin

  # copy to /opt
  cp -pvr "${srcdir}"/riscv/* "${pkgdir}"/opt/riscv32-unknown-elf/

  # strip host binaries
  find "${pkgdir}"/opt/riscv32-unknown-elf/bin "${pkgdir}"/opt/riscv32-unknown-elf/libexec -type f -and \( -executable \) -exec strip '{}' \;

  # replace binutils copies with symlinks
  for file in  "${pkgdir}"/opt/riscv32-unknown-elf/riscv32-unknown-elf/bin/*; do
    just_name="$(basename "$file")"
    rm "$file"
    ln -s "../../bin/riscv32-unknown-elf-$just_name" "$file"
  done

  # install symlinks to /usr/bin
  for file in "${pkgdir}"/opt/riscv32-unknown-elf/bin/*; do
    just_name="$(basename "$file")"
    ln -s "/opt/riscv32-unknown-elf/bin/$just_name" "${pkgdir}/usr/bin/$just_name"
  done
}

Could you please take a look at this?

Thank you,

Jakub

libguestfs-dev

I built your package and noticed virt-sparsify is not part of it -> no binary is created in /usr/bin/ for it.
Is that intentional?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.