Leopold Toetsch wrote:
The various HPUX-related changed didn't make it into the release, sorry.
Could you please provide a patch for all outstanding issued.
Leo,
Not a problem. I'm attaching a patch which I believe fixes all the build
issues on HP-UX, and shouldn't cause any breakage with any other platforms.
I've retested on Linux and cygwin (although cygwin has problems with
dynclasses), and all's well.
A summary of the changes:
* Two extra flags are made available (cc_shared, which was already
extracted from Perl but not used, and ccdlflags, which probably needs a
better name!), and added to the makefile etc.
* I've removed -g from ld_debug, hopefully not upsetting anyone.
Platforms that need it should probably add it as I would have thought
that they are in the minority; can a Solaris person confirm that it's ok
for them.
* Turn off aligned_funcptr for HP-UX; is that ok how I've done it?
With this patch HP-UX builds 'out of the box' for me (as hopefully will
other future platforms), but we still need a viable solution to get
execute permissions onto libraries in runtime/parrot/dynext/*.
The signal test fails due to the shell, and two of the nci tests hangs.
I've attached a separate patch (not for committing!) which makes these
two tests fail so that things run to completion. The manifest test which
I had failing in the past was purely because I didn't have svn installed
even though I had the .svn files.
The patch seems safe enough... Is it ok to apply straight away, or
should let a few people try it before applying?
Thanks in advance,
Nick
Index: config/init/data.pl
===================================================================
--- config/init/data.pl (revision 8279)
+++ config/init/data.pl (working copy)
@@ -51,6 +51,10 @@
# with position-independent code suitable for dynamic loading.
cc_shared => $Config{cccdlflags}, # e.g. -fpic for GNU cc.
+ # Compiler flags used to allow dynamic libraries to access the
+ # binary's symbols
+ ccdlflags => $Config{ccdlflags}, # e.g. -Wl,-E on HP-UX
+
# C++ compiler -- used to compile parts of ICU. ICU's configure
# will try to find a suitable compiler, but it prefers GNU c++ over
# a system c++, which might not be appropriate. This setting
@@ -100,7 +104,7 @@
cc_ldflags => '', # prefix for ldflags (necessary for
Win32)
ld_out => '-o ', # ld output file. Keep the trailing
space.
- ld_debug => '-g ', # include debug info in executable
+ ld_debug => '', # include debug info in executable
# should we have a dependancy upon arc to generate .a's?
blib_lib_libparrot_a => 'blib/lib/libparrot$(A)',
Index: config/auto/gcc.pl
===================================================================
--- config/auto/gcc.pl (revision 8279)
+++ config/auto/gcc.pl (working copy)
@@ -154,6 +154,10 @@
gccversion => $gccversion,
HAS_aligned_funcptr => 1
);
+
+ Configure::Data->set(
+ HAS_aligned_funcptr => 0)
+ if $^O eq 'hpux';
}
1;
Index: config/gen/makefiles/root.in
===================================================================
--- config/gen/makefiles/root.in (revision 8279)
+++ config/gen/makefiles/root.in (working copy)
@@ -86,6 +86,8 @@
CC_INC = ${cc_inc}
CFLAGS = ${ccflags} ${cc_debug} ${ccwarn} $(CC_INC) ${cc_hasjit}
${cg_flag} ${gc_flag}
C_LIBS = ${libs}
+CC_SHARED = ${cc_shared}
+CCDLFLAGS = ${ccdlflags}
LINK = ${link}
LINKFLAGS = ${linkflags} ${link_debug} ${ld_debug}
LD = ${ld}
@@ -649,8 +651,8 @@
$(PARROT) : $(IMCC_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
lib/Parrot/OpLib/core.pm $(SRC_DIR)/parrot_config$(O) \
$(MINIPARROT)
- $(LINK) ${ld_out}$(PARROT) $(LINKFLAGS) $(IMCC_DIR)/main$(O) \
- $(ALL_PARROT_LIBS) $(SRC_DIR)/parrot_config$(O)
+ $(LINK) ${ld_out}$(PARROT) $(LINKFLAGS) $(CCDLFLAGS) \
+ $(IMCC_DIR)/main$(O) $(ALL_PARROT_LIBS) $(SRC_DIR)/parrot_config$(O)
#
# TODO build the real miniparrot
#
Index: config/gen/makefiles/CFLAGS.in
===================================================================
--- config/gen/makefiles/CFLAGS.in (revision 8279)
+++ config/gen/makefiles/CFLAGS.in (working copy)
@@ -13,6 +13,11 @@
# io should be -Wunsed clean
{^io/} s/-Wno-unused/-Wunused/
+# files which make their way into dynamically loaded files should be compiled
+# with shared library options
+src/extend.c +{${cc_shared}}
+src/nci_test.c +{${cc_shared}}
+
# imcc file settings
{^imcc/} -{-Wwrite-strings -Wcast-qual} s/-Wno-unused/-Wunused/
imcc/instructions.c -{-Wformat-nonliteral} # noisy
Index: config/gen/makefiles/dynclasses_pl.in
===================================================================
--- config/gen/makefiles/dynclasses_pl.in (revision 8279)
+++ config/gen/makefiles/dynclasses_pl.in (working copy)
@@ -31,7 +31,7 @@
our $LIBPARROT = qq[${build_dir}/src/extend${o}];
# XXX: ultimately, this should be replaced with:
# $LIBPARROT = qq[-L../blib/lib -lparrot];
-our $CFLAGS = qq[${ccflags} ${cc_debug} ${ccwarn} ${cc_hasjit} ${cg_flag}
${gc_flag}];
+our $CFLAGS = qq[${ccflags} ${cc_shared} ${cc_debug} ${ccwarn} ${cc_hasjit}
${cg_flag} ${gc_flag}];
# Here comes some stuff for Win32.
our $PATHQUOTE = '';
This patch disables two nci tests which hang so that a 'make test' runs
to completion.
DON'T COMMIT!
Index: t/pmc/nci.t
===================================================================
--- t/pmc/nci.t (revision 8279)
+++ t/pmc/nci.t (working copy)
@@ -298,49 +298,7 @@
.sub test @MAIN
- # load libnci_test.so
- .local string library_name
- library_name = 'libnci_test'
- .local pmc libnci_test
- libnci_test = loadlib library_name
- unless libnci_test goto NOT_LOADED
- print library_name
- print " was successfully loaded\n"
-
- # address of nci_dlvar_int
- .local pmc nci_dlvar_int
- nci_dlvar_int = dlvar libnci_test, "nci_dlvar_int"
-
- # the contained structure pointer
- .local pmc nci_dlvar_int_decl
- nci_dlvar_int_decl = new ResizablePMCArray
- push nci_dlvar_int_decl, .DATATYPE_INT
- push nci_dlvar_int_decl, 0
- push nci_dlvar_int_decl, 0
- assign nci_dlvar_int, nci_dlvar_int_decl
-
- I2 = nci_dlvar_int[0]
- print I2
print "\n"
-
- .local pmc nci_v
- nci_v = dlfunc libnci_test, "nci_v", "v"
- nci_v()
- I1 = nci_dlvar_int[0]
- print I1
- print "\n"
- nci_v()
- I1 = nci_dlvar_int[0]
- print I1
- print "\n"
- nci_v()
- I1 = nci_dlvar_int[0]
- print I1
- print "\n"
- nci_v()
- I1 = nci_dlvar_int[0]
- print I1
- print "\n"
NOT_LOADED:
.end
CODE
@@ -2301,50 +2259,7 @@
.include "datatypes.pasm"
.sub test @MAIN
-
- # load libnci_test.so
- .local string library_name
- library_name = 'libnci_test'
- .local pmc libnci_test
- libnci_test = loadlib library_name
- unless libnci_test goto NOT_LOADED
- print library_name
- print " was successfully loaded\n"
-
- # address of nci_dlvar_int
- .local pmc nci_dlvar_int
- nci_dlvar_int = dlvar libnci_test, "nci_dlvar_int"
-
- # the contained structure pointer
- .local pmc nci_dlvar_int_decl
- nci_dlvar_int_decl = new ResizablePMCArray
- push nci_dlvar_int_decl, .DATATYPE_INT
- push nci_dlvar_int_decl, 0
- push nci_dlvar_int_decl, 0
- assign nci_dlvar_int, nci_dlvar_int_decl
-
- I2 = nci_dlvar_int[0]
- print I2
print "\n"
-
- .local pmc nci_vv
- nci_vv = dlfunc libnci_test, "nci_vv", "vv"
- nci_vv()
- I1 = nci_dlvar_int[0]
- print I1
- print "\n"
- nci_vv()
- I1 = nci_dlvar_int[0]
- print I1
- print "\n"
- nci_vv()
- I1 = nci_dlvar_int[0]
- print I1
- print "\n"
- nci_vv()
- I1 = nci_dlvar_int[0]
- print I1
- print "\n"
NOT_LOADED:
.end
CODE