Skip to content

Comments

fixes for win32 and osx32 segmented architecture changes#446

Merged
WalterBright merged 2 commits intodlang:masterfrom
braddr:segmented
Oct 12, 2011
Merged

fixes for win32 and osx32 segmented architecture changes#446
WalterBright merged 2 commits intodlang:masterfrom
braddr:segmented

Conversation

@braddr
Copy link
Member

@braddr braddr commented Oct 12, 2011

Really not sure how the win32 problems weren't caught in my previous builds. The only thing I can see is that the commits on my system were in a different order than what showed up in the pull request.

The machobj.c changes were because I didn't test the osx build before submitting. Oops.

The full druntime, phobos, and dmd test suites pass for both platforms.

WalterBright added a commit that referenced this pull request Oct 12, 2011
fixes for win32 and osx32 segmented architecture changes
@WalterBright WalterBright merged commit 6315333 into dlang:master Oct 12, 2011
@bitraft
Copy link

bitraft commented Oct 12, 2011

lion os x :

dmd -m32 -c -d -o- -Isrc -Iimport -Hfimport/core/cpuid.di src/core/cpuid.d
make: *** [import/core/cpuid.di] Segmentation fault: 11
make: *** Deleting file `import/core/cpuid.di'

@braddr
Copy link
Member Author

braddr commented Oct 12, 2011

On 10/11/2011 11:49 PM, Long Chang wrote:

lion os x :

dmd -m32 -c -d -o- -Isrc -Iimport -Hfimport/core/cpuid.di src/core/cpuid.d
make: *** [import/core/cpuid.di] Segmentation fault: 11
make: *** Deleting file `import/core/cpuid.di'

$ dmd -m32 -c -d -o- -Isrc -Iimport -Hfimport/core/cpuid.di src/core/cpuid.d
$ echo $?
0
$ uname -a
Darwin nexus 11.1.0 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64 x86_64

I can't reproduce this on the auto-tester machine. I recall sean installing a non-default compiler since the default
lion was producing buggy code. What gcc/g++ do you have installed?

$ g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ls -l /usr/bin/g++
lrwxr-xr-x 1 root wheel 12 Aug 9 09:48 /usr/bin/g++ -> llvm-g++-4.2

@bitraft
Copy link

bitraft commented Oct 12, 2011

root@loong # uname -a
Darwin loong.jundee.2288.org 11.1.0 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81
1/RELEASE_X86_64 x86_64
root@loong # g++ -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1
1/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

@braddr
Copy link
Member Author

braddr commented Oct 12, 2011

You have a slightly newer build of gcc based on a slightly newer build of llvm. Unlikely to matter, but not impossible.

You're going to need to do some digging since I can't reproduce it.

  1. make sure you did a make -f posix.mak clean followed by make -f posix.mak
  2. retest

If that works, your build was unclean

If that doesn't work:

  1. edit posix.mak and switch the GFLAGS line to use the first, with -DDEBUG
  2. make -f posix.mak clean; make -f posix.mak
  3. re-build druntime, does that compile still crash?
  4. run the compiler under gdb to get a stack trace: gdb --args

@bitraft
Copy link

bitraft commented Oct 13, 2011

I make a clean rebuild, it still crash . before your commit, it is working .

I am not sure how to use GDB, here is my test result :

root@loong /opt/installs/d/druntime# gdb dmd
GNU gdb 6.3.50-20050815 (Apple version gdb-1706) (Tue Jul 19 23:33:12 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ... done

(gdb) show args
Argument list to give program being debugged when it is started is "".
(gdb) set args -m32 -c -d -o- -Isrc -Iimport -Hfimport/core/cpuid.di src/core/cpuid.d
(gdb) show args
Argument list to give program being debugged when it is started is "-m32 -c -d -o- -Isrc -Iimport -Hfimport/core/cpuid.di src/core/cpuid.d".
(gdb) r
Starting program: /usr/local/bin/dmd -m32 -c -d -o- -Isrc -Iimport -Hfimport/core/cpuid.di src/core/cpuid.d
Reading symbols for shared libraries ++.................................................................................................................................. done
Reading symbols for shared libraries . done

Program received signal SIGTRAP, Trace/breakpoint trap.
0x8fe01030 in __dyld__dyld_start ()
(gdb) backtrace
#0 0x8fe01030 in __dyld__dyld_start ()
#1 0x00001000 in ?? ()

@bitraft
Copy link

bitraft commented Oct 13, 2011

sorry for my mistake , It seem use a dmd from /usr/local/bin, but I put new builded dmd in /opt/loca/bin . your path is working now with my g++ .

braddr pushed a commit to braddr/dmd that referenced this pull request Oct 22, 2012
This only works because of a bug in dmd, and it was probably supposed to...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants