Skip to content
Snippets Groups Projects
  1. Jan 17, 2018
    • Andrea Gussoni's avatar
      Add checks for `no-pie` flag for cross-compilers · 0735acd2
      Andrea Gussoni authored
      The check to see if a compiler supports the `no-pie` flag was done only
      for the main C compiler, and not for the cross-compilers used for
      creating the executables for the different supported architectures.
      
      This commit introduces the aforementioned missing checks.
      
      In addition instead of hard-coding the flags to check in the CMakeLists
      file we have a list that we pass each time we instantiate a project for
      the cross-compilers, and we check for the availability of all the flags.
      
      In order to do this we need to apply a sort of serialization and
      deserialization to avoid the "unpack" of the list passed as argument to
      the external project (that is implemented as a `;` separated string).
      
      Also implemented a fix suggested in the merge request for a line that
      mistakenly added the `TEST_CFLAGS` variable to the `NO_PIE` variable.
      0735acd2
  2. Oct 29, 2017
    • Alessandro Di Federico's avatar
      Warn the user if `mmap_min_addr` is too high · abd3154c
      Alessandro Di Federico authored
      Many Linux distributions prevent programs from mapping memory pages at
      low addresses. This can lead the translated program to segfault without
      any additional explanation. This happens in particular with ARM
      binaries, which tend to have the first segment allocated at very low
      addresses.
      
      This behavior can be configured through
      `/proc/sys/vm/mmap_min_addr`. This commit introduces a warning to the
      user in the `li-csv-to-ld-options` script in case a segment with an
      address lower than `mmap_min_addr` is requested.
      abd3154c
  3. Oct 28, 2017
  4. Aug 28, 2017
    • Pietro Fezzardi's avatar
      Add `-no-pie` to compiler flags · 55eb769a
      Pietro Fezzardi authored
      Add this flag to the flags used for Runtime tests and to the flags used
      in the translate script.
      
      Recent GCC versions (`gcc-7` and later) enable PIE by default, and
      `-fno-pie` apparently is not enough to disable it.
      55eb769a
    • Pietro Fezzardi's avatar
      Make `-Wnoexcept-type` non-fatal, if present · 9824a1b6
      Pietro Fezzardi authored
      This warning was introduced with gcc-7 to (quoting the documentation)
      "Warn if the C++1z feature making noexcept part of a function type
      changes the mangled name of a symbol relative to C++14. Enabled by -Wabi
      and -Wc++1z-compat.".
      
      It is triggered from the `GenericFunctor` class template. It can be
      safely made not fatal, because this class template is not exposed
      outside and the whole project is currently compiled with the same C++
      standard compiler flags.
      
      This commit adds machinery to `CMakeLists.txt` to make the warning not
      fatal, but only if present. Disabling it when not present would trigger
      build errors.
      9824a1b6
  5. Aug 13, 2017
    • Alessandro Di Federico's avatar
      Fix handling of devirtualized calls · 069ae70d
      Alessandro Di Federico authored
      When we have an indirect call (or jump) we are sometimes able to
      identify one or more possible targets, therefore, as an optimization,
      before performing the indirect jump we check if the target is one of the
      expected ones.
      
      This optimization however was creating two issues with the handling of
      indirect function calls: 1) the call to the `function_call` marker was
      no longer positioned right before the terminator and 2) the function
      call was no longer identified as an indirect function call but as call
      to `anyPC`. This commit fixes these two issues.
      
      These issues have been identified thanks to a report from Andrea
      Gussoni.
      069ae70d
  6. Aug 12, 2017
  7. Aug 01, 2017
  8. Jul 07, 2017
    • Alessandro Di Federico's avatar
      Handle `.bss`-only data segment · 9db62b28
      Alessandro Di Federico authored
      This commit fixes an assertion triggered by the fact that a segment
      includes exclusively zero-initialized data (i.e., size on file is 0,
      memory size is not). In this case LLVM detects the fact that the global
      variable associated to the segment is composed exclusively composed by
      0s and uses a `ConstantAggregateZero` as an initializer instead of a
      `ConstantDataArray`.
      
      Currently the solution is ignore that data, however, in the future it
      might be beneficial to be able to read data from `.bss`, even if we just
      have zeros there.
      
      Thanks to Thorbjoern Schulz for reporting this bug.
      9db62b28
  9. Apr 27, 2017
  10. Apr 21, 2017
    • Alessandro Di Federico's avatar
      Fix GCC 6.3.0 warnings · 24c1df35
      Alessandro Di Federico authored
      This commit fixes some warnings given by GCC 6.3.0.
      
      * Some `assert(false)` are not recognized as `noreturn`ing. They have
        been replaced with `llvm_unreachable`.
      * Added `-Wno-ignored-attributes`: attributes are not part the function
        name mangling, and therefore they might create some problems when they
        are involved in template arguments. We don't care.
      * Specializations of `readPointer` functions in `binaryfile.h` are now
        `inline`, so they don't appear as "unused" functions.
      24c1df35
  11. Apr 06, 2017
    • Alessandro Di Federico's avatar
      Merge delay slots into branch instruction · f92ccfa5
      Alessandro Di Federico authored
      QEMU marks each input instruction with a special
      pseudo-instruction. This commit makes revamb ignore such instructions
      coming after a write to a `btarget` variable, which is an indication
      that a delay slot is starting. In this way, the instruction will look
      larger and re-translating part of it will not break the branch
      instruction.
      f92ccfa5
  12. Apr 04, 2017
  13. Apr 03, 2017
    • Alessandro Di Federico's avatar
      Set CSVs linkage to internal · e0315833
      Alessandro Di Federico authored
      This simple commit should improve performance of the generated program
      sensibly. Basically all the global variables will have internal linkage
      from now on (unless the `--external` parameter is specified on the
      command line). This way, the compiler will be able to avoid load/store
      instructions when leaving code in the current translation unit.
      e0315833
    • Alessandro Di Federico's avatar
      Bugfix: use `opt` output in `translate` · e01f0cc2
      Alessandro Di Federico authored
      In `translate -O2` we optimize the LLVM IR both with `llc` and
      `opt`. However due to a bug in `translate`, `opt` was invoked but its
      output was never used.
      e01f0cc2
    • Alessandro Di Federico's avatar
      Disable slow backend optimization · 12ed8219
      Alessandro Di Federico authored
      Introduce the `-disable-machine-licm` argument when the `translate`
      script invokes `llc` with `-O2`.
      12ed8219
  14. Apr 02, 2017
    • Alessandro Di Federico's avatar
      OSRA: clear `BoundedVvalue::Bounds` before merging · 0ba8bb80
      Alessandro Di Federico authored
      We used to assert that a `BoundedValue` must not have any entries in the
      `Bounds` field before translating a `boost::icl` interval to a
      `BoundedValue`. However, if the `Value` associated to the `BoundedValue`
      is a `Constant`, we might have an entry in `BoundedValue::Bounds`
      immediately after constructing the object. This commit fixes this
      problem by simply updating the assertion and clearing the field before
      re-populating it.
      0ba8bb80
Loading