Jump to page: 1 2 3
Thread overview
[Issue 1940] New: Phobos buildscripts do not work on x86_64
Mar 25, 2008
d-bugmail
Mar 25, 2008
d-bugmail
Mar 25, 2008
d-bugmail
Jun 09, 2008
d-bugmail
Jun 09, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Jun 23, 2008
d-bugmail
Dec 09, 2008
d-bugmail
Mar 08, 2009
d-bugmail
March 25, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1940

           Summary: Phobos buildscripts do not work on x86_64
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: lindevel@gmx.net


The src/phobos/ linux.mak buildscripts will not work on a x86_64 system. They
need following modification for me:
    sed -i -e "s:CC=.*:CC=gcc -m32:" `find . -name '*.mak' -type f`
    sed -i -e "s:CFLAGS=.*:CFLAGS=${CFLAGS}:" `find . -name '*.mak' -type f`

The first is because dmd does not build x86_64 object files, and thus linking
into a x86_64 binary will not work. (-m32 left out for linking)
The second is because it does not respect my provided CFLAGS.

Additionaly these scripts do not respect my DFLAGS, and g++ is the hardcoded C++ compiler.

My suggestion is to review those files for style.


-- 

March 25, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1940


andrei@metalanguage.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|bugzilla@digitalmars.com    |andrei@metalanguage.com




------- Comment #1 from andrei@metalanguage.com  2008-03-25 09:53 -------
(In reply to comment #0)
> The src/phobos/ linux.mak buildscripts will not work on a x86_64 system. They
> need following modification for me:
>     sed -i -e "s:CC=.*:CC=gcc -m32:" `find . -name '*.mak' -type f`
>     sed -i -e "s:CFLAGS=.*:CFLAGS=${CFLAGS}:" `find . -name '*.mak' -type f`
> 
> The first is because dmd does not build x86_64 object files, and thus linking
> into a x86_64 binary will not work. (-m32 left out for linking)
> The second is because it does not respect my provided CFLAGS.
> 
> Additionaly these scripts do not respect my DFLAGS, and g++ is the hardcoded C++ compiler.

I don't understand the second change - is the makefile supposed to pick the CFLAGS and DFLAGS in the current environment?


-- 

March 25, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1940





------- Comment #2 from lindevel@gmx.net  2008-03-25 17:07 -------
IIRC Makefiles are supposed to do that, yes.
Though I admit that is part of the style changes and probably on most systems
not necessarily needed.


-- 

June 09, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1940





------- Comment #3 from lindevel@gmx.net  2008-06-09 07:44 -------
The issue is still present in 2.014.

$(LIB) : $(SRC2LIB) $(OBJS) $(MAKEFILE_LIST)
    @echo $(DMD) $(DFLAGS) -lib -of$@ "[...tons of files...]"
    @$(DMD) $(DFLAGS) -lib -of$@ $(SRC2LIB) $(OBJS)

Since CC is no longer listed there, I assume that now dmd generates the library
by calling internaly what I assume is the environment variable CC.
It does not seem to know about its own limitation of being unable to generate
64bit code, and forgets to tell CC (in my case GCC) to create a 32bit library.

-m32 is understood by at least GCC and ICC, so even though it is not portable per se, it seems good enough to be passed to CC.


-- 

June 09, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1940





------- Comment #4 from lindevel@gmx.net  2008-06-09 07:51 -------
PS: You still do not respect neither CFLAGS nor DFLAGS given on the commandline, which requires people to patch your makefiles.


-- 

June 23, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1940





------- Comment #5 from lindevel@gmx.net  2008-06-23 02:35 -------
Issue still exists in 2.015.


-- 

June 23, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1940





------- Comment #6 from lindevel@gmx.net  2008-06-23 02:52 -------
    sed -i \
        -e "s:DMD = .*:DMD = ${S}/bin/dmd:" \
        -e "s:CC = .*:CC = gcc -m32:" \
        -e "s:CFLAGS = .*:CFLAGS = ${CFLAGS}:" \
        `find . -name '*.mak' -type f`

This is the sed command required to make dmd 2.015 work.


-- 

June 23, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1940


andrei@metalanguage.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Comment #7 from andrei@metalanguage.com  2008-06-23 09:47 -------
(In reply to comment #6)
>     sed -i \
>         -e "s:DMD = .*:DMD = ${S}/bin/dmd:" \
>         -e "s:CC = .*:CC = gcc -m32:" \
>         -e "s:CFLAGS = .*:CFLAGS = ${CFLAGS}:" \
>         `find . -name '*.mak' -type f`
> 
> This is the sed command required to make dmd 2.015 work.
> 

Why change the compiler from dmd to /bin/dmd?


-- 

June 23, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1940





------- Comment #8 from lindevel@gmx.net  2008-06-23 10:04 -------
${S}...

Forgot to copy the description from bug #2164:
${S} is the sourcecode directory. To make this work generically, I recommend to
either use a relative path, or a variable set to an absolute path. I.e.:
export top_srcdir = $(CURDIR) # Toplevel Makefile
DMD = $(top_srcdir)/bin/dmd


-- 

June 23, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1940





------- Comment #9 from lindevel@gmx.net  2008-06-23 10:06 -------
PS: Reason for that change is: If you use dmd, it will call the system dmd, not the new one. This can cause issues or confusion.


-- 

« First   ‹ Prev
1 2 3