Skip to content

Commit

Permalink
[build] Improve darwin build flags to enable gdb debugging
Browse files Browse the repository at this point in the history
compile parrot_old static. some ar implementations cannot even find
object files with the same basename when debugging (darwin).
use this for debugging with gdb.
keep -undefined dynamic_lookup only for dynamically loaded bundles.
honor cmdline flags for --ld and --link.

Closes GH #1096
  • Loading branch information
Reini Urban committed Nov 12, 2014
1 parent 396a5b0 commit ccb9bb4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Expand Up @@ -83,6 +83,8 @@
provide now --debugging[=flags] for debugging. [GH #1099]
+ Enable --disable-shared (or --parrot_is_shared=0) to link against static
libparrot [GH #1101]
+ Change darwin build flags to improve gdb debugging,
no -undefined dynamic_lookup. #1096
- Documentation
+ Add missing manpages for pbc_disassemble, pbc_dump, pbc_merge
+ Improved src/string/encoding/tables.c pod.
Expand Down
2 changes: 1 addition & 1 deletion config/gen/makefiles/root.in
Expand Up @@ -935,7 +935,7 @@ $(PARROTOLD) : $(FRP_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
src/parrot_config$(O) $(MINIPARROT)
$(LINK) @ld_out@$@ \
$(FRP_DIR)/main$(O) src/parrot_config$(O) \
$(RPATH_BLIB) $(ALL_PARROT_LIBS) $(LINKFLAGS) $(LINK_DYNAMIC)
$(O_FILES) $(ICU_SHARED) $(C_LIBS) $(LINKFLAGS)
#IF(win32 and has_mt): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1

$(PARROT) : $(FRPTWO_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
Expand Down
13 changes: 8 additions & 5 deletions config/init/hints/darwin.pm
Expand Up @@ -50,7 +50,7 @@ sub runstep {
$flags->{ccflags} .= '-Wno-long-double ';
}

$flags->{linkflags} .= " -undefined dynamic_lookup";
$flags->{linkflags} .= ""; # -undefined dynamic_lookup";

_probe_for_libraries($conf, $flags, 'fink');
_probe_for_libraries($conf, $flags, 'macports');
Expand All @@ -68,14 +68,14 @@ sub runstep {
osvers => $osvers,
ccflags => $flags->{ccflags},
ldflags => $flags->{ldflags},
ccwarn => "-Wno-shadow",
#ccwarn => "-Wno-shadow",
libs => $libs,
share_ext => '.dylib',
load_ext => '.bundle',
link => 'c++',
link => $flags->{link} || 'c++',
linkflags => $flags->{linkflags},
ld => 'c++',
ld_share_flags => '-dynamiclib -undefined dynamic_lookup',
ld => $flags->{ld} || 'c++',
ld_share_flags => '-dynamiclib',
ld_load_flags => '-undefined dynamic_lookup -bundle',
memalign => 'some_memalign',
has_dynamic_linking => 1,
Expand Down Expand Up @@ -303,6 +303,9 @@ the command-line options C<darwin_no_fink> and/or C<darwin_no_macports>.
The functionality is tested in F<t/steps/init/hints/darwin-01.t>.
Note that debugging with F<gdb> requires static linking (F<parrot_old>) and
no C<-undefined dynamic_lookup>
=cut

# Local Variables:
Expand Down

0 comments on commit ccb9bb4

Please sign in to comment.