python: RPATH on Cray (#4209)
* python: ensure that distutils sets valid compiler options for RPATH on cray * python: add cray-rpath patches for python@2.3:3.0.1 and python@3.1: * python: in patch(..., when="@a:b platform=c"), limit b must be specified * python: assume that python@4 will break the cray patches
This commit is contained in:
		 Milton Woods
					Milton Woods
				
			
				
					committed by
					
						 Gregory Lee
						Gregory Lee
					
				
			
			
				
	
			
			
			 Gregory Lee
						Gregory Lee
					
				
			
						parent
						
							87ebb0fc15
						
					
				
				
					commit
					7ea0e143c5
				
			
							
								
								
									
										12
									
								
								var/spack/repos/builtin/packages/python/cray-rpath-2.3.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								var/spack/repos/builtin/packages/python/cray-rpath-2.3.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | |||||||
|  | --- a/Lib/distutils/unixccompiler.py	2003-06-02 05:27:40.000000000 +1000 | ||||||
|  | +++ b/Lib/distutils/unixccompiler.py	2017-05-13 13:52:45.554213616 +1000 | ||||||
|  | @@ -208,7 +208,8 @@ | ||||||
|  |          elif compiler[:3] == "gcc" or compiler[:3] == "g++": | ||||||
|  |            return "-Wl,-R" + dir | ||||||
|  |          else: | ||||||
|  | -            return "-R" + dir | ||||||
|  | +            # Patched by spack to use gcc syntax by default: | ||||||
|  | +            return "-Wl,-R" + dir | ||||||
|  |   | ||||||
|  |      def library_option(self, lib): | ||||||
|  |          return "-l" + lib | ||||||
							
								
								
									
										15
									
								
								var/spack/repos/builtin/packages/python/cray-rpath-3.1.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								var/spack/repos/builtin/packages/python/cray-rpath-3.1.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | --- a/Lib/distutils/unixccompiler.py	2009-05-09 21:55:12.000000000 +1000 | ||||||
|  | +++ b/Lib/distutils/unixccompiler.py	2017-05-13 14:30:18.077518999 +1000 | ||||||
|  | @@ -299,10 +299,8 @@ | ||||||
|  |                  else: | ||||||
|  |                      return "-Wl,-R" + dir | ||||||
|  |              else: | ||||||
|  | -                # No idea how --enable-new-dtags would be passed on to | ||||||
|  | -                # ld if this system was using GNU ld.  Don't know if a | ||||||
|  | -                # system like this even exists. | ||||||
|  | -                return "-R" + dir | ||||||
|  | +                # Patched by spack to use gcc syntax by default: | ||||||
|  | +                return "-Wl,-R" + dir | ||||||
|  |   | ||||||
|  |      def library_option(self, lib): | ||||||
|  |          return "-l" + lib | ||||||
| @@ -92,6 +92,10 @@ class Python(AutotoolsPackage): | |||||||
|     # Patch does not work for Python 3.1 |     # Patch does not work for Python 3.1 | ||||||
|     patch('ncurses.patch', when='@:2.8,3.2:') |     patch('ncurses.patch', when='@:2.8,3.2:') | ||||||
|  |  | ||||||
|  |     # Ensure that distutils chooses correct compiler option for RPATH on cray: | ||||||
|  |     patch('cray-rpath-2.3.patch', when="@2.3:3.0.1 platform=cray") | ||||||
|  |     patch('cray-rpath-3.1.patch', when="@3.1:3.99  platform=cray") | ||||||
|  |  | ||||||
|     _DISTUTIL_VARS_TO_SAVE = ['LDSHARED'] |     _DISTUTIL_VARS_TO_SAVE = ['LDSHARED'] | ||||||
|     _DISTUTIL_CACHE_FILENAME = 'sysconfig.json' |     _DISTUTIL_CACHE_FILENAME = 'sysconfig.json' | ||||||
|     _distutil_vars = None |     _distutil_vars = None | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user