Can't build simple OpenMP offloading programs (needs -no-pie)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-10 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
gcc-9 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
$cat prod.f90
program main
implicit none
integer, parameter :: sp = selected_
integer, parameter :: n = 4096
real(sp), allocatable :: a(:), b(:), c(:), c2(:)
integer :: i
allocate( a(n), b(n), c(n) )
c = 0._sp
call random_number(a)
call random_number(b)
!$omp target teams map(to: a, b) map(from: c)
!$omp distribute parallel do
do i = 1, n
c(i) = a(i)*b(i)
end do
!$omp end target teams
c2 = a*b
print*, maxval( abs(c2-c) )
end program
$ gfortran -O3 -flto -fopenmp -foffload=
/usr/bin/ld: /tmp/ccyvMF16.
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
Ubuntu 20.10 x86_64
Xeon E3-1505m-v6
Nvidia Quadro M2200
That doesn't happen on Ubuntu 20.04
summary: |
- Can't build simple OpenMP offloading programs on Ubuntu 20.10 + Can't build simple OpenMP offloading programs (needs -no-pie) |
Building with "-no-pie" resolves the problem.