This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Possible fix for mingw32 directory relocation problems


On Mon, Jan 16, 2012 at 11:03 PM, Pierre Muller
<pierre.muller@ics-cnrs.unistra.fr> wrote:
>
> ÂAfter some debugging,
> we finally managed to find out that
> mingw32 specific directory relocations are related
> to msys -> mingw32 argument conversions.
>
> http://sourceware.org/ml/gdb-patches/2012-01/msg00537.html
>
> This is explained in:
>
> http://www.mingw.org/wiki/Posix_path_conversion
>
> This page also allows to understand why
> using mingw32 style paths for prefix at configure
> level works and avoid the troubles encountered.
>
> This conversion concerns defines passed by command line arguments
> to gcc, which are specific to main.o
> compilation, as found in gdb/Makefile.in
> 1520-
> 1521:# main.o needs an explicit build rule to get TARGET_SYSTEM_ROOT and
> BINDIR.
> 1522-main.o: $(srcdir)/main.c
> 1523: Â $(COMPILE) $(TARGET_SYSTEM_ROOT_DEFINE) -DBINDIR=\"$(bindir)\"
> $(srcdir)/main.c
> 1524- Â $(POSTCOMPILE)
> 1525-
>
> ÂBut this leads to a conversion:
> Â-DBINDIR="/usr/local/bin\"
> gets transformed into '-D' 'BINDIR="E:/msys/mingw32/msys/1.0/local/bin"'
>
> ÂWhile other pates used in relocate_gdb_directory calls
> are macros defined inside gdb/config.h
>
> config.h:#define DEBUGDIR "/usr/local/lib/debug"
> config.h:#define GDB_DATADIR "/usr/local/share/gdb"
> config.h:#define JIT_READER_DIR "/usr/local/lib/gdb"
>
> Those are of course not affected by msys command-line argument conversion.
>
> ÂThe first question is:
> Why do we need to pass BINDIR (and TARGET_SYSTEM_ROOT_DEFINE)
> at the command line instead of inside config.h as for other
> directories?
>
> ÂIf the answer to the first question is "we don't",
> then I need help about how to convert those
> Makefile.in variables into new entries of generated config.h file.

I agree that we don't need BINDIR=xxxxx in the compiler command line option.

>
> ÂI don't have enough knowledge about autoconf scripts to
> handle this...
> ÂAn extra bonus of this change would be that it would
> render the special rule for main.o compilation unnecessary.
>
> Comments most welcome and help needed...
>
> Pierre Muller
> GDB pascal language maintainer
>
>

I'm not quite familiar with autoconf either. So, suppose we can put
BINDIR in config.h, I think we still have some problem.
Those values (DEBUGDIR, GDB_DATADIR, JIT_READER_DIR, BINDIR) were
macro definition strings, so there are location are still fixed.

But under Windows, I think there are many conditions that gdb.exe and
other related gdb's share folder will be copied and pasted to many
different paths. So, a true relocate scheme is still necessary.


asmwarrior


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]