mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 01:46:15 +01:00
f0b2fb9816
Crash is likely because gcc has become more strict in recent version. To fix it I had to add the -no-pie flag and move mult10 to the text section.
29 lines
636 B
Python
29 lines
636 B
Python
#! /usr/bin/env python
|
|
# encoding: utf-8
|
|
|
|
import sys
|
|
|
|
def configure(conf):
|
|
conf.load('gcc gas')
|
|
try:
|
|
size = sys.maxint
|
|
except AttributeError:
|
|
size = sys.maxsize # python 3.2
|
|
if size < 4**21:
|
|
conf.fatal('this example is for 64-bit systems only')
|
|
|
|
def build(bld):
|
|
# https://waf.io/apidocs/tools/asm.html
|
|
bld.program(
|
|
source = 'main.c test.S',
|
|
target = 'asmtest',
|
|
defines = 'foo=12',
|
|
asflags = '-Os',
|
|
includes = '.',
|
|
linkflags = '-no-pie')
|
|
|
|
def disp(ctx):
|
|
node = ctx.bldnode.ant_glob('asmtest*', remove=False)[0]
|
|
ctx.exec_command('%s' % node.abspath(), shell=False)
|
|
bld.add_post_fun(disp)
|