Marco Atzeri
2018-11-03 09:11:04 UTC
I uploaded a patch for 7.3.0, based on previous draft of Tobias,
plus 3 test cases.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47030
With that the dllexport of variable in the common block
now works for this variant of "!GCC$ attributes dllimport"
---------------------------------
$ cat *3.f90
! call_mydll.f90 --
! Call the library
!
program call_mydll
real :: x
common /mydata/ x
!GCC$ attributes dllimport :: x
x = 1.0
call print
write(*,*) 'In program: X = ', x
end program call_mydll
! mydll.f90 --
! Simple library (to be compiled and linked as DLL/SO)
!
subroutine print
real :: x
common /mydata/ x
!GCC$ attributes dllexport :: x
write(*,*) 'X = ', x
end subroutine print
------------------------------------
./call_mydll-3.exe
X = 1.00000000
In program: X = 1.00000000
---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus
plus 3 test cases.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47030
With that the dllexport of variable in the common block
now works for this variant of "!GCC$ attributes dllimport"
---------------------------------
$ cat *3.f90
! call_mydll.f90 --
! Call the library
!
program call_mydll
real :: x
common /mydata/ x
!GCC$ attributes dllimport :: x
x = 1.0
call print
write(*,*) 'In program: X = ', x
end program call_mydll
! mydll.f90 --
! Simple library (to be compiled and linked as DLL/SO)
!
subroutine print
real :: x
common /mydata/ x
!GCC$ attributes dllexport :: x
write(*,*) 'X = ', x
end subroutine print
------------------------------------
./call_mydll-3.exe
X = 1.00000000
In program: X = 1.00000000
---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus