use /usr/bin/ld.sun instead of /usr/bin/ld
[unleashed.git] / usr / src / cmd / sgs / test / ld / x64 / tls / ie / Makefile
blob833c9b56776d346f2524d20ef3f45347783502c3
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
12 # Copyright 2012, Richard Lowe.
14 include $(SRC)/Makefile.master
16 CFLAGS = -O1 -m64
18 LINK.c = env LD_ALTEXEC=$(PROTO)/usr/bin/amd64/ld.sun $(CC) $(CFLAGS) -o $@ $^
19 COMPILE.c = $(CC) $(CFLAGS) -c -o $@ $^
20 COMPILE.s = $(CC) $(CFLAGS) -c -o $@ $^
22 .KEEP_STATE:
24 install default: all
26 .c.o:
27 $(COMPILE.c)
29 .s.o:
30 $(COMPILE.s)
32 # A basic use of TLS that uses the movq m/r --> movq i/r variant
33 PROGS += style2
34 STYLE2OBJS = style2.o
35 style2: $(STYLE2OBJS)
36 $(LINK.c)
38 # A copy of style2 that uses %r13 in the TLS sequence, and thus excercises the
39 # REX transitions of the movq mem,reg -> movq imm,reg variant.
40 PROGS += style2-with-r13
41 STYLE2R13OBJS = style2-with-r13.o
42 style2-with-r13: $(STYLE2R13OBJS)
43 $(LINK.c)
45 # A copy of style2 that uses %r12 in the TLS sequence, so we can verify that
46 # it is _not_ special to this variant
47 PROGS += style2-with-r12
48 STYLE2R12OBJS = style2-with-r12.o
49 style2-with-r12: $(STYLE2R12OBJS)
50 $(LINK.c)
52 # A copy of style2 that has a R_AMD64_GOTTPOFF relocation with a bad insn sequence
53 STYLE2BADNESSOBJS = style2-with-badness.o
54 style2-with-badness: $(STYLE2BADNESSOBJS)
55 -$(LINK.c)
57 # A basic use of TLS that uses the addq mem/reg --> leaq mem,reg variant
58 PROGS += style1
59 STYLE1OBJS = style1-main.o style1-func.o
60 style1: $(STYLE1OBJS)
61 $(LINK.c)
63 # A copy of style1-func that uses %r13 in the TLS sequence and thus excercises
64 # the REX transitions. of the addq mem,reg --> leaq mem,reg variant
65 PROGS += style1-with-r13
66 STYLE1R13OBJS = style1-main.o style1-func-with-r13.o
67 style1-with-r13: $(STYLE1R13OBJS)
68 $(LINK.c)
70 # A copy of style1-func that uses %r12 to test the addq mem,reg --> addq imm,reg variant
71 PROGS += style1-with-r12
72 STYLE1R12OBJS = style1-main.o style1-func-with-r12.o
73 style1-with-r12: $(STYLE1R12OBJS)
74 $(LINK.c)
76 all: $(PROGS)
78 clobber clean:
79 rm -f $(PROGS) $(STYLE1OBJS) $(STYLE1R13OBJS) $(STYLE1R12OBJS) \
80 $(STYLE2OBJS) $(STYLE2R13OBJS) $(STYLE2R12OBJS) $(STYLE2BADNESSOBJS)
82 fail: style2-with-badness FRC
84 FRC: