Initial groundwork for ARM64 support
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7001 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
bca384e691
commit
460b3f59a9
11 changed files with 101 additions and 51 deletions
|
@ -144,8 +144,8 @@ stub_env.Append(LINKFLAGS = ['$NODEFLIBS_FLAG']) # no default libraries
|
|||
stub_env.Append(LINKFLAGS = ['$MAP_FLAG']) # generate map file
|
||||
|
||||
if msvs_version >= 10.0:
|
||||
# no relocations that our resource editor ignores
|
||||
stub_env.Append(LINKFLAGS = ['/FIXED'])
|
||||
if stub_env['TARGET_ARCH'] != 'arm64': # LNK1246: '/FIXED' not compatible with 'ARM64' target machine
|
||||
stub_env.Append(LINKFLAGS = ['/FIXED']) # no relocations that our resource editor ignores
|
||||
|
||||
stub_uenv = stub_env.Clone()
|
||||
stub_uenv.Append(CPPDEFINES = ['_UNICODE', 'UNICODE'])
|
||||
|
|
|
@ -313,7 +313,7 @@ def generate(env):
|
|||
env.PrependENVPath('LIB', lib_path)
|
||||
env.PrependENVPath('PATH', exe_path)
|
||||
|
||||
env['ENV']['CPU'] = (targ_arc.upper(), 'i386')['x86' in targ_arc.lower()] # i386 or AMD64
|
||||
env['ENV']['CPU'] = (targ_arc.upper(), 'i386')['x86' in targ_arc.lower()] # AMD64/ARM64 or i386
|
||||
env['ENV']['TARGETOS'] = 'BOTH'
|
||||
env['ENV']['APPVER'] = '4.0'
|
||||
env['ENV']['MSSDK'] = sdk_path
|
||||
|
@ -340,6 +340,8 @@ def generate(env):
|
|||
|
||||
if 'AMD64' in targ_arc.upper():
|
||||
env['AS'] = 'ml64'
|
||||
if 'ARM64' in targ_arc.upper():
|
||||
env['AS'] = 'armasm64'
|
||||
|
||||
env['SHLINK'] = '$LINK'
|
||||
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')
|
||||
|
|
|
@ -175,6 +175,8 @@ class MSPE:
|
|||
self.NTHOffset = fanew
|
||||
self.NTOHMagic = ReadU16LE(f, fanew+4+20)
|
||||
self.IsPEP = 0x20b == self.NTOHMagic # IMAGE_NT_OPTIONAL_HDR64_MAGIC?
|
||||
def ReadMachine(self):
|
||||
return ReadU16LE(self._f, self.NTHOffset+4+0)
|
||||
def ReadCharacteristics(self):
|
||||
return ReadU16LE(self._f, self.NTHOffset+4+18)
|
||||
def WriteCharacteristics(self, value):
|
||||
|
@ -202,7 +204,8 @@ def SetPESecurityFlagsWorker(filepath):
|
|||
pe.WriteCharacteristics(ifh_c)
|
||||
ioh_dc = pe.ReadDllCharacteristics()
|
||||
ioh_dc |= 0x0100 # +IMAGE_DLLCHARACTERISTICS_NX_COMPAT (DEP)
|
||||
ioh_dc |= 0x0400 # +IMAGE_DLLCHARACTERISTICS_NO_SEH
|
||||
if pe.ReadMachine() != 0xaa64: # ARM64 forces exception directory?
|
||||
ioh_dc |= 0x0400 # +IMAGE_DLLCHARACTERISTICS_NO_SEH
|
||||
ioh_dc |= 0x8000 # +IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE (TODO: Should we set this on .DLLs?)
|
||||
if not (ifh_c & 0x0001): # IMAGE_FILE_RELOCS_STRIPPED?
|
||||
ioh_dc |= 0x0040 # +IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE (ASLR)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue