Closed GoogleCodeExporter closed 9 years ago
Trying the failed test compile by hand works fine - I will investigate some
more:
kfeng@ml115:/tmp$ cat junk.d
int main(char[][] args)
{return args.sizeof-1;}
kfeng@ml115:/tmp$ gdc -o junk junk.d
kfeng@ml115:/tmp$ ./junk
kfeng@ml115:/tmp$
Original comment by kfmf...@gmail.com
on 6 Dec 2010 at 3:56
Removing -fversion=Posix from Linux-gdc.cmake gets me further, but now, I am
stuck with errors in CMakeDetermineCompilerABI.cmake around Lines 38-50 where
you seem to be doing string matching:
kfeng@ml115:~/src/cmaked2/tests$ ./run_tests_linux.sh
-- The C compiler identification is GNU
-- The D compiler identification is unknown
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
**** Debug Info: Enter CMakeDInformation.cmake
**** Debug Info: CMAKE_SYSTEM_NAME = Linux
**** Debug Info: CMAKE_D_COMPILER_ID =
**** Debug Info: CMAKE_BASE_NAME = gdc
**** Debug Info: Exit CMakeDInformation.cmake
-- Check for working D compiler: /opt/usr/local/bin/gdc
**** Debug Info: Enter CMakeDInformation.cmake
**** Debug Info: CMAKE_SYSTEM_NAME = Linux
**** Debug Info: CMAKE_D_COMPILER_ID =
**** Debug Info: CMAKE_BASE_NAME = gdc
**** Debug Info: Exit CMakeDInformation.cmake
-- Check for working D compiler: /opt/usr/local/bin/gdc -- works
-- Detecting D compiler ABI info
**** Debug Info: Enter CMakeDInformation.cmake
**** Debug Info: CMAKE_SYSTEM_NAME = Linux
**** Debug Info: CMAKE_D_COMPILER_ID =
**** Debug Info: CMAKE_BASE_NAME = gdc
**** Debug Info: Exit CMakeDInformation.cmake
-- Detecting D compiler ABI info - done
gdc: unrecognized option '-wi'
cc1d: warning: unrecognized gcc debugging option: e
cc1d: warning: unrecognized gcc debugging option: s
cc1d: warning: unrecognized gcc debugging option: =
cc1d: warning: unrecognized gcc debugging option: /
cc1d: warning: unrecognized gcc debugging option: h
cc1d: warning: unrecognized gcc debugging option: o
cc1d: warning: unrecognized gcc debugging option: m
cc1d: warning: unrecognized gcc debugging option: e
cc1d: warning: unrecognized gcc debugging option: /
cc1d: warning: unrecognized gcc debugging option: k
cc1d: warning: unrecognized gcc debugging option: f
cc1d: warning: unrecognized gcc debugging option: e
cc1d: warning: unrecognized gcc debugging option: n
cc1d: warning: unrecognized gcc debugging option: g
cc1d: warning: unrecognized gcc debugging option: /
cc1d: warning: unrecognized gcc debugging option: s
cc1d: warning: unrecognized gcc debugging option: r
cc1d: warning: unrecognized gcc debugging option: c
cc1d: warning: unrecognized gcc debugging option: /
cc1d: warning: unrecognized gcc debugging option: c
cc1d: warning: unrecognized gcc debugging option: m
cc1d: warning: unrecognized gcc debugging option: k
cc1d: warning: unrecognized gcc debugging option: e
cc1d: warning: unrecognized gcc debugging option: d
cc1d: warning: unrecognized gcc debugging option: _
cc1d: warning: unrecognized gcc debugging option: t
cc1d: warning: unrecognized gcc debugging option: e
cc1d: warning: unrecognized gcc debugging option: s
cc1d: warning: unrecognized gcc debugging option: t
cc1d: warning: unrecognized gcc debugging option: _
cc1d: warning: unrecognized gcc debugging option: b
cc1d: warning: unrecognized gcc debugging option: u
cc1d: warning: unrecognized gcc debugging option: i
cc1d: warning: unrecognized gcc debugging option: l
cc1d: warning: unrecognized gcc debugging option: d
cc1d: warning: unrecognized gcc debugging option: /
cc1d: warning: unrecognized gcc debugging option: r
cc1d: warning: unrecognized gcc debugging option: e
cc1d: warning: unrecognized gcc debugging option: l
cc1d: warning: unrecognized gcc debugging option: e
cc1d: warning: unrecognized gcc debugging option: s
cc1d: warning: unrecognized gcc debugging option: e
cc1d: warning: unrecognized gcc debugging option: /
cc1d: warning: unrecognized gcc debugging option: _
cc1d: warning: unrecognized gcc debugging option: 8
cc1d: warning: unrecognized gcc debugging option: /
cc1d: warning: unrecognized gcc debugging option: C
cc1d: warning: unrecognized gcc debugging option: k
cc1d: warning: unrecognized gcc debugging option: e
cc1d: warning: unrecognized gcc debugging option: F
cc1d: warning: unrecognized gcc debugging option: i
cc1d: warning: unrecognized gcc debugging option: l
cc1d: warning: unrecognized gcc debugging option: e
cc1d: warning: unrecognized gcc debugging option: s
cc1d: warning: unrecognized gcc debugging option: /
cc1d: warning: unrecognized gcc debugging option: _
cc1d: warning: unrecognized gcc debugging option: 8
cc1d: warning: unrecognized gcc debugging option: .
cc1d: warning: unrecognized gcc debugging option: d
cc1d: warning: unrecognized gcc debugging option: -
cc1d: warning: unrecognized gcc debugging option: d
cc1d: warning: unrecognized gcc debugging option: e
cc1d: warning: unrecognized gcc debugging option: e
cc1d: warning: unrecognized gcc debugging option: n
cc1d: warning: unrecognized gcc debugging option: d
cc1d: warning: unrecognized gcc debugging option: .
cc1d: warning: unrecognized gcc debugging option: c
cc1d: warning: unrecognized gcc debugging option: m
cc1d: warning: unrecognized gcc debugging option: k
cc1d: warning: unrecognized gcc debugging option: e
cc1d: warning: unrecognized gcc debugging option: .
cc1d: warning: unrecognized gcc debugging option: t
cc1d: warning: unrecognized gcc debugging option: m
/home/kfeng/src/cmaked2/tests/app_8/app_8.d:3: Error: module a is in file 'a.d'
which cannot be read
import path[0] =
/opt/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.6/../../../../include
/d2/4.4.6/x86_64-unknown-linux-gnu
import path[1] =
/opt/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.6/../../../../include
/d2/4.4.6
CMake Error at /usr/local/share/cmake-2.8/Modules/dependencies.cmake:21 (file):
file Internal CMake error when trying to open file:
/home/kfeng/src/cmaked_test_build/release/app_8/CMakeFiles/app_8.d-depend.cmake.tmp
for reading.
Original comment by kfmf...@gmail.com
on 6 Dec 2010 at 4:47
With gdc, say I have a hellomodule that I want to build into an libh.a - I
would want to do this to compile and archive:
> gdc -c hellomodule.d -o hellomodule.o
> ar rcs libh.a hellomodule.o
For hellomain, I would want to compile and link like this:
> gdc -I "../hellomodule/" -c hellomain.d -o hellomain.o
> gdc hellomain.o -L ../hellomodule/ -lh -o hello
I am still trying to manipulate cmaked2 to behave like this.
Any suggestions would be greatly appreciated.
Original comment by kfmf...@gmail.com
on 7 Dec 2010 at 10:04
OK, I've managed to hack together something that builds a static hellomodule
and links it with an hellomain. Later, I will see if I can generalize what I
did and put it back into cmaked2 and get the tests to build, but here is an
overview for those of you who are trying to get gdc to work:
1. remove -fversion=Posix from Linux-gdc.cmake
2. SET( CMAKE_D_CREATE_STATIC_LIBRARY "<CMAKE_AR> rcs <TARGET> <OBJECTS>" )
3. hellomodule's CMakeLists.txt - note the hellomodule.o, not hellomodule.d here
ADD_LIBRARY( h STATIC hellomodule.o )
SET_TARGET_PROPERTIES( h PROPERTIES LINKER_LANGUAGE D )
4. hellomain's CMakeLists.txt - hardcoding the -I is obviously no good: will
cleanup later
SET( CMAKE_D_FLAGS "-I /home/kfeng/dev/robolab/d/src/hellomodule" )
ADD_EXECUTABLE( hello hellomain.d )
TARGET_LINK_LIBRARIES( hello h )
SET_TARGET_PROPERTIES( hello PROPERTIES LINKER_LANGUAGE D )
Original comment by kfmf...@gmail.com
on 7 Dec 2010 at 11:59
It looks like the fixes in Comment 4 are easy to patch except the hard-coding
in 4.
SET( CMAKE_D_FLAGS "-I /home/kfeng/dev/robolab/d/src/hellomodule" )
I am still investigating how to set CMAKE_D_FLAGS safely.
Original comment by kfmf...@gmail.com
on 7 Dec 2010 at 1:54
If I use INCLUDE_DIRECTORIES(), I can avoid the hard-coding noted in Comment 5.
With these fixes, I get a slight improvement in running ./run_tests_linux.sh
56% tests passed, 4 tests failed out of 9
Original comment by kfmf...@gmail.com
on 7 Dec 2010 at 2:01
Having problems tweaking this line:
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/app_4.dir/link.txt
--verbose=1
/opt/usr/local/bin/gdc -fversion=debugBuild -g CMakeFiles/app_4.dir/app_4
-oapp_4 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 ../lib_2/liblib_2.a -lc
I want to get rid of -lc and -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 - anyone
know how to affect the generation of link.txt? I can't seem to trace its
generation from the cmaked2 code.
Original comment by kfmf...@gmail.com
on 8 Dec 2010 at 2:33
OK - I'm committing what I have - there are still issues as only 5/9 tests
build and clear on Ubuntu amd64, but this should be better than before.
Original comment by kfmf...@gmail.com
on 8 Dec 2010 at 2:58
Original comment by jens.k.mueller@gmail.com
on 9 Dec 2010 at 9:03
Thanks for your effort.
I pushed a change to make it work.
I tested with
gdc (GCC) 4.4.5 20101001 (gdc hg, using dmd 2.049)
on Debian.
Let me know if it does not work for you. All examples are building but app_7
segfaults.
Original comment by jens.k.mueller@gmail.com
on 9 Dec 2010 at 10:12
Better let me also know if it works. Then I'll close this bug. But having app_7
segfault is annoying. I'll guess it's a bug in gdc. Do you know anything more?
Original comment by jens.k.mueller@gmail.com
on 15 Dec 2010 at 11:33
Hi, I apologize for the delay.
On my amd64 Ubuntu 10.04.1 LTS, it still fails to link/test 4, 5, 6, 7 (see
attachment).
gdc (GCC) 4.4.6 20101206 (prerelease gdc hg, using dmd 2.050)
I suspect this may be due to my configuration - in the build, I see references
to gcc 4.4.5 - it's been a few weeks since I looked at this - I may have built
from the 4.4.5 code-base (don't know why this would show up as 4.4.6 in gdc,
though).
Anyhow, it's fine with me if you would like to close this bug.
Thank you for looking in this.
Original comment by kfmf...@gmail.com
on 16 Dec 2010 at 2:49
Attachments:
I should try the same version as you to see if it works here. I hope I find
some time for doing this the next days. Won't close this bug until it works for
you. I'll guess we do not have much users but for the little we have it should
work.
Original comment by jens.k.mueller@gmail.com
on 18 Dec 2010 at 12:18
Sorry. I just found some time to look into the issue.
I followed the instructions on https://bitbucket.org/goshawk/gdc/wiki/Home.
$ hg tip
changeset: 433:aba6c8857d64
tag: tip
user: Iain Buclaw <ibuclaw@ubuntu.com>
date: Tue Jan 04 05:27:29 2011 +0000
summary: Issue #133 - Segfault On AA Foreach
And it works for me. I cannot reproduce the problem. Which version are you
using. I wonder why you are using gcc 4.4.6 instead of 4.4.5. This is really
strange.
$ gdc --version
gdc (GCC) 4.4.5 20101001 (gdc hg, using dmd 2.051)
Copyright (C) 2010 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.
Can you try again closely following https://bitbucket.org/goshawk/gdc/wiki/Home?
Original comment by jens.k.mueller@gmail.com
on 4 Jan 2011 at 9:36
Just for the record to clarify how I run the tests. I change to tests
directory. Then
$ mkdir build
$ cd build
$ cmake ..
$ make all
$ make test
Somehow make test shows all tests as passing.
$ ctest -V
shows that app7 actually segfaults. Don't know why make test acts that stupid.
Original comment by jens.k.mueller@gmail.com
on 4 Jan 2011 at 9:45
I believe the issue it fixed in ea37db6ef4.
Original comment by jens.k.mueller@gmail.com
on 24 Feb 2011 at 6:53
Original issue reported on code.google.com by
kfmf...@gmail.com
on 6 Dec 2010 at 3:46