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

Relocation error for FT benchmark in Class C #177

Open
blackgeorge-boom opened this issue Jul 20, 2022 · 8 comments
Open

Relocation error for FT benchmark in Class C #177

blackgeorge-boom opened this issue Jul 20, 2022 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@blackgeorge-boom
Copy link
Collaborator

Using: -mcmodel=large:

appft.c:75: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
@blackgeorge-boom blackgeorge-boom added the bug Something isn't working label Jul 20, 2022
@compor
Copy link
Collaborator

compor commented Jul 20, 2022

Combinations tried in relation to musl libc:

  • -mcmodel=medium crashes clang during compilation of musl, thus not tested in relation to ft.
  • -mcmodel=large produces the aforementioned relocation error during linking, but unsure if this also occurs for x86_64. musl builds ok.

@compor compor self-assigned this Apr 5, 2023
@blackgeorge-boom
Copy link
Collaborator Author

Related: ssrg-vt/popcorn-compiler#10

@compor
Copy link
Collaborator

compor commented Apr 5, 2023

potentially relevant: google/ExoPlayer#9933

@compor
Copy link
Collaborator

compor commented Apr 6, 2023

An update:

  • -Bsymbolic linker flag didn't work
  • -mcmodel=large compiler flag didn't work

These were both used for building musl libc and ft.

I also tried -fno-tls-model to no effect, just in case it is related.

@compor
Copy link
Collaborator

compor commented Apr 6, 2023

However,

Adding -fPIC to the CFLAGS in unifico's common.mk makefile reduced the relocation errors, from
(this requires a clean rebuild in between changes in the makefile)

appft.c:76: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:78: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:93: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:97: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:100: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:103: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:105: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:108: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:112: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:114: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:115: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:117: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:120: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:122: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:124: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:125: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:130: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:133: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:135: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:136: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
appft.c:141: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:151: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:154: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:159: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:0: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:0: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:172: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:172: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:172: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:180: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:183: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:188: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:0: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:197: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:199: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:202: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:207: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:0: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:0: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:220: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:220: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:220: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:229: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:231: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:66: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:74: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
fft3d.c:138: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
mainft.c:60: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
mainft.c:63: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
mainft.c:67: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
mainft.c:95: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
c_timers.c:23: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
c_timers.c:28: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
c_timers.c:38: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
c_timers.c:39: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21
c_timers.c:45: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21

to

 [LD] ft_aarch64_unaligned.out                                                                                                                                                                                                                 
appft.c:93: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                           
appft.c:114: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                          
appft.c:124: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                  
appft.c:135: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                          
fft3d.c:154: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                          
fft3d.c:0: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                            
fft3d.c:0: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                            
fft3d.c:172: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                          
fft3d.c:172: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                  
fft3d.c:172: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                  
fft3d.c:183: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                  
fft3d.c:0: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                    
fft3d.c:197: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                  
fft3d.c:202: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                          
fft3d.c:0: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                            
fft3d.c:0: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                    
fft3d.c:220: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                          
fft3d.c:220: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                          
fft3d.c:220: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                          
fft3d.c:74: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                   
c_timers.c:23: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                        
c_timers.c:28: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                        
c_timers.c:38: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                
c_timers.c:39: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                
c_timers.c:45: error: relocation overflow in R_AARCH64_ADR_PREL_PG_HI21                                                                                                                                                                        
make[1]: *** [../../common/common.mk:284: ft_aarch64_unaligned.out] Error 1 

@compor
Copy link
Collaborator

compor commented Apr 6, 2023

Reading https://clang.llvm.org/docs/UsersManual.html#cmdoption-ftls-model seems that the TLS option I used was not right, but in any case, this seems more related to the OMP build case as suggested in ssrg-vt/popcorn-compiler#10

@blackgeorge-boom
Copy link
Collaborator Author

Thanks for the update @compor. Yes, this seems like a nasty error.

@compor
Copy link
Collaborator

compor commented Apr 6, 2023

The combination of flags that reduce the errors is -mcmodel=large and -fPIC for both musl libc and ft.

Using -flts-model=local had no effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants