pic/no-pic code

0 views
Skip to first unread message

Jason Moxham

unread,
Jul 30, 2009, 1:28:25 PM7/30/09
to mpir...@googlegroups.com
Hi

Trac ticket 26 "Have make check check both shared and static code"
Solution below

For each function that we want to have a static version of (shared is tested
by default)

eg dive_1.asm for generic-x86 is used by the test t-fat.c in tests/mpn

So to tests/mpn/Makefule.am we add

if ENABLE_STATIC
if ENABLE_SHARED
check_PROGRAMS += static_t_fat
static_t_fat_SOURCES = t-fat.c
static_t_fat_LDFLAGS = -static
endif
endif

this gives us another test "static_t_fat" which is only built and run in the
case when we build both libraries .

This fix is architecture independent , so if , for example , alpha wanted a
static verision of mpn_divrem_1 then all other arch's would have the extra
static test whether they needed it or not. I dont think this is a major
problem as , most functions are implemented in similar ways , and if it is we
could also special case a particular arch , or just ignore it(which is
effectively what we do now)

Jason

Jason Moxham

unread,
Jul 30, 2009, 5:29:51 PM7/30/09
to mpir...@googlegroups.com
Looking at our existing code in the mpn directory  I can see that
static/shared differences exist for

dive_1  for pentium k6_mmx p6 pentium4_sse2 k7 x86
popham for k7_mmx pentium4_mmx k6_mmx
popcount for pentium
hamdist pentium
mode1o for powerpc32 x86_64 pentium k6 p6 pentium4_sse2 k7
gcd_1 for k7 k6
mul_basecase k6 p6 k7
sqr_basecase k6  p6 k7
l/r shift  k7
aorsmul_1   k6 p6 k7
mul_1  k7
aors_n   x86 k7  netburst
udiv sparc32  pa32_hppa1_1
mod_1 pentium
fat-entry  x86 x86_64
sqr_diagonal sparc32_v9

I'll add the changes for the tests below
mpz/t-hamdist.c mpz/t-popcount.c mpn/t-fat.c mpn/t-instrument.c
There are no "direct" test program for most of the functions.

I wonder if it may be better to enable it for all make check test programs ,
as this would pick up compiler error which otherwise it would not , although
what is the chance of a compiler error in a static build only when we build
both .

The "try" program should also test both shared and static varients.
I've not looked at the windows code in x86w or x86_64w as the test framework
is different.

Jason

Jason Moxham

unread,
Aug 2, 2009, 10:50:40 AM8/2/09
to mpir...@googlegroups.com
We now have a new make target
static_try
for try testing the static library when we build both shared and static
librarys
Reply all
Reply to author
Forward
0 new messages