Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rock head no longer compiles on Win32 #469

Closed
nddrylliog opened this issue Nov 15, 2012 · 22 comments
Closed

Rock head no longer compiles on Win32 #469

nddrylliog opened this issue Nov 15, 2012 · 22 comments
Labels

Comments

@nddrylliog
Copy link
Member

Running make rescue on HEAD just crashes in c_rock.

I tried reverting to 28062d6 but it fails with:

source, Compiling regenerated modules...
gcc.exe -std=gnu99 -Wall -g -I.\libs/headers/ -Irock_tmp -O0 -w -DROCK_BUILD_DATE=\"2012-11-15\" -DROCK_BUILD_TIME=\"01:40\" -c rock_tmp\source\rock\r
ock.c -o rock_tmp\rock_rock.o -I.\libs/headers/ -Irock_tmp -D__OOC_USE_GC__ -DGC_NO_THREAD_REDIRECTS -I.libs\source -I.libs\sdk -O0 -w -DROCK_BUILD_DA
TE=\"2012-11-15\" -DROCK_BUILD_TIME=\"01:40\"
In file included from rock_tmp/source\rock\frontend\CommandLine-fwd.h:47:0,
                 from rock_tmp/source\rock\rock-fwd.h:21,
                 from rock_tmp/source\rock\rock.h:6,
                 from rock_tmp\source\rock\rock.c:3:
rock_tmp/source\rock\frontend\Help-fwd.h:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '/' token
C compiler failed (with code 1), aborting compilation process
[FAIL]
make[2]: *** [self] Error 1
make[2]: Leaving directory `/g/Dev/rock'
make[1]: *** [bootstrap] Error 2
make[1]: Leaving directory `/g/Dev/rock'
make: *** [rescue] Error 2

So.. I'm not sure what's wrong. I might try with the 0.9.3 release again, just to be sure.

@nddrylliog
Copy link
Member Author

(oh also, poke @Shamanas)

@nddrylliog
Copy link
Member Author

Just as a reference, rock 0.9.3 (from the -source distrib on Files here) does compile on Win32 with a few tweaks. Here's what you need:

  • change --enable-threads=posix to --enable-threads=win32 in the buildgc target of libs/Makefile (line 59)
  • comment out the first and last lines (opening and closing brackets) of the version (!windows) { block in sdk/os/Time.ooc - that would be lines 31 and 57
  • comment out line 76 of sdk/io/FileWriter.ooc - the one with mkstemp - and add a line with 'null' right after it. (that's a nasty hack.)

After those changes, rock builds itself fine (the last two changes aren't necessary to obtain a c_rock.exe but you won't be able to bootstrap otherwise)

Afaik, all those issues have been fixed in HEAD, but other have been introduced that make c_rock crash. I haven't run gdb yet so no ideas why.

@alexnask
Copy link
Collaborator

I'll have a look :D

@duckinator
Copy link

Good! Because I can't get Windows 7 to stop barfing all over VirtualBox. :D

@alexnask
Copy link
Collaborator

On my platform, c_rock managed to compile rock with bootstrap rock-0.9.4-prealpha4-bootstrap-only.tar.bz2, will try to recompile rock with rock as soon as I sort some pathing issues.

@alexnask
Copy link
Collaborator

@nddrylliog I think the error may be related to ROCK_BUILD_DATE and ROCK_BUILD_TIME, though they seem to be passed alright :-/
(I remember having similar errors due to them and if you look at CommandLine's source, it's the only place they are used)

@nddrylliog
Copy link
Member Author

Dammit, we should look for a way to include the build date / build time other than using that +-D hack...

But I thought you managed to get c_rock to compile rock? I never even got that far..

Also, keep in mind rock 0.9.3 passes ROCK_BUILD_{DATE,TIME} exactly in the same fashion (afaict) but compiles fine on Win32.

What's your config exactly? Here's mine:

  • Windows 7, 64-bit
  • mingw32, gcc 4.5

@alexnask
Copy link
Collaborator

  • Windows 7, 64-bit
  • tdm64-gcc-4.7.1-3 (http://tdm-gcc.tdragon.net/, basically MinGW with latest GCC and some changes to support 64 bit better)

@alexnask
Copy link
Collaborator

I'm compiling through msys

@alexnask
Copy link
Collaborator

@nddrylliog Btw, in build/Makefile, pthreads is always linked although not needed on win32

@nddrylliog
Copy link
Member Author

@Shamanas That's a good point. I guess the make driver should be fixed to avoid that.

@alexnask
Copy link
Collaborator

Will be done as soon as I figure out why reverting back to score == -1 in FunctionCall suggest breaks #315 (but not the rest of the FuncType scoring)

@alexnask
Copy link
Collaborator

I don't seem to have a problem, I managed to bootstrap rock :-/
I'll try again in a clean install and break down all the steps here

@alexnask
Copy link
Collaborator

Note: I have built and installed pthreads-win32 on my system

(Everything executed in the msys prompt)

  • Clone rock using msysgit
  • Download rock-0.9.4-prealpha4-bootstrap-only.tar.bz2 (dont want to get into the trouble of getting curl/wget for windows)
  • Run make in /c/rock => get a bunch of undefined references to _imp_GC_malloc at linking
  • Open up /c/rock/libs/Makefile and replace line 78 with
    cp sources/.libs/libgc.dll.a ${GC_PATH}/libgc.a
  • Save the Makefile up and run make again, you should get an error about a missing dll
  • Copy /c/rock/libs/sources/.libs/libgc-1.dll to /c/rock
  • Run "OOC=bin/c_rock make self"
  • Wait patiently
  • You should get an error that c:/rock/libs/win64/libgc.a is not located (weird, the sequence driver arch detection works but not the make driver's one)
  • Copy /c/rock/libs/win32 to /c/rock/libs/win64
  • Run "OOC=bin/c_rock make self" again
  • It should work! \o/

Now, to recompile rock with rock

  • Run "export ROCK_SDK=C:\rock\sdk" and "export ROCK_DIST=C:\rock" (don't use /c/rock/sdk and /c/rock, it won't work!)
  • Run "make self"

That's it! :D

@nddrylliog
Copy link
Member Author

@Shamanas Okay.. now I'm really confused. I ran 'make rescue' in a cloned rock repo and everything worked fine. WHAT. Did you fix the issue that I had up there in the first place?

@alexnask
Copy link
Collaborator

Nope, I guess something must have gone wrong in the unpacking or downloading of the bootstrap (...maybe?)
Btw, do you not have the GC issue (undefined references if you link against libgc.a instead of libgc.dll.a) ?

@nddrylliog
Copy link
Member Author

No I don't have any GC issues at all. For me the issue is just no longer there. Also I think it's time I upload a new bootstrap-only. Let me do that right now.

@alexnask
Copy link
Collaborator

Ok, go ahead.

Btw, I think I will be releasing 0.9.4 after fixing a couple more bugs (hopefully some generic access related ones)

@nddrylliog
Copy link
Member Author

@Shamanas I was about to ask that :) Releasing 0.9.4 + updating the brew formula to the latest (and the AUR package) would be nice.

@alexnask
Copy link
Collaborator

I have no idea how to update a brew formula or an AUR package, who is usually responsible of those tasks? ^^'

@alexnask
Copy link
Collaborator

Also, I guess I'm closing this

@nddrylliog
Copy link
Member Author

@Shamanas I'll do the brew (it's just about sending a pull request to mxcl/homebrew) as for the AUR package I'll ask @HappyDawn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants