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

CI: add riscv64 job #693

Merged
merged 1 commit into from
Oct 15, 2024
Merged

CI: add riscv64 job #693

merged 1 commit into from
Oct 15, 2024

Conversation

Bodigrim
Copy link
Contributor

No description provided.

@clyring
Copy link
Member

clyring commented Sep 19, 2024

From the CI log:

  [36 of 47] Compiling Lift             ( tests/Lift.hs, tests/Lift.o, tests/Lift.dyn_o )
  /usr/bin/ld.bfd: cbits/fpstring.o: relocation R_RISCV_HI20 against `fps_compare' can not be used when making a shared object; recompile with -fPIC
  /usr/bin/ld.bfd: cbits/is-valid-utf8.o: relocation R_RISCV_HI20 against `__stack_chk_guard@@GLIBC_2.27' can not be used when making a shared object; recompile with -fPIC
  /usr/bin/ld.bfd: cbits/itoa.o: relocation R_RISCV_HI20 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
  /usr/bin/ld.bfd: cbits/shortbytestring.o: relocation R_RISCV_HI20 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
  /usr/bin/ld.bfd: unresolvable R_RISCV_CALL_PLT relocation against symbol `qsort@@GLIBC_2.27'
  /usr/bin/ld.bfd: unresolvable R_RISCV_HI20 relocation against symbol `__stack_chk_guard@@GLIBC_2.27'
  collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
  compilation terminated.
  
  <no location info>: error:
      `riscv64-linux-gnu-gcc' failed in phase `Linker'. (Exit code: 1)

@Bodigrim
Copy link
Contributor Author

Any riscv64 experts around? Maybe @supersven?

@supersven
Copy link

Any riscv64 experts around? Maybe @supersven?

@Bodigrim Cool, thanks a lot for your interest in RISC-V! It's great to see people adopting it.

It looks like you're mixing Position Independent Code (PIC) with non-pic code. That's why the linker screams for -fPIC 😉

PIC is the default on most (all?) RISC-V Linuxes. It has been introduced as default into GHC after the version on the CI (9.4.7) was released. So, you have to tell GHC to emit PIC code. (https://downloads.haskell.org/ghc/9.4.7/docs/users_guide/phases.html?highlight=fpic#ghc-flag--fPIC)

I've adjusted your branch to do this: https://github.com/supersven/bytestring/pull/1/files
It's running green now.

@Bodigrim
Copy link
Contributor Author

Thanks @supersven!

@clyring this is ready for review.

@Bodigrim Bodigrim merged commit 2ad59ee into haskell:master Oct 15, 2024
27 of 28 checks passed
@Bodigrim Bodigrim deleted the riscv64 branch October 15, 2024 21:39
Bodigrim added a commit that referenced this pull request Oct 15, 2024
@Bodigrim Bodigrim added this to the 0.12.2.0 milestone Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants