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

Build optlink with masm 9 or 10 and with dmc-tools instead of SLR #2

Merged
merged 2 commits into from Mar 7, 2013

Conversation

rainers
Copy link
Contributor

@rainers rainers commented Feb 16, 2013

  • build libs with dmc's lib
  • masm (v9 or v10) complained about a number of "mov AL,errorCode" which had to be changed to AX (I guess it would not assume an external to fit into a byte)
  • add a number of ridiculous "BYTE PTR" modifiers
  • do not build loadx.exe

To build, set environment variable DM (if not \dm), add dmc\bin to the path and run build_optlink.bat.

- masm (v9 or v10) complained about a number of "mov AL,errorCode" which had to be changed to AX (I guess it would not assume an external to fit into a byte)
- I had to add a number of ridiculous "BYTE PTR" modifiers
- do not build loadx.exe
@ghost
Copy link

ghost commented Feb 16, 2013

Btw @WalterBright, maybe you know this already but here's a handy tip if you want to diff this locally instead of using Github:

git fetch upstream pull/2/head:pull2
git checkout pull2
git difftool --dir-diff head~1

You would probably replace upstream with master or whatever your remote name is.

@ghost
Copy link

ghost commented Feb 16, 2013

Looks good, this compiles and links link.exe for me using VS10.

@rainers
Copy link
Contributor Author

rainers commented Feb 17, 2013

The compiled version hangs for me after a few files when trying to build
the dmd test suite, but continues for a few files if I restart the test
build.
I remember this was a problem solved in the past. I didn't find a
matching entry in the log, is the respective patch committed?

@WalterBright
Copy link
Contributor

Optlink fails on multicore machines. You have to set the "affinity" to one core.

@WalterBright
Copy link
Contributor

I use:

imagecfg -a 0x1 \cbx\optlinkc\os2link\objnt\link.exe

imagecfg.exe is available on the intarnets. http://www.robpol86.com/index.php/ImageCFG

@CyberShadow
Copy link
Member

Maybe OptLink can do this instead?

SetProcessAffinityMask(GetCurrentProcess(), 1);

@rainers
Copy link
Contributor Author

rainers commented Feb 17, 2013

Thanks, that explains it. Until we have it in optlink as Vladimir
suggested, I've added it to the build rules.

@WalterBright WalterBright merged this pull request into DigitalMars:master Mar 7, 2013
WalterBright added a commit that referenced this pull request Mar 7, 2013
Build optlink with masm 9 or 10 and with dmc-tools instead of SLR
@ghost
Copy link

ghost commented Mar 11, 2013

Is it correct to just call this external app like that? xfBuild used an elaborate way to call the

@ghost
Copy link

ghost commented Mar 11, 2013

Is it correct to just call this external app like that? xfBuild used an elaborate way to call the SetProcessAffinityMask function, and it was specifically made to tame Optlink, see here.

@rainers
Copy link
Contributor Author

rainers commented Mar 11, 2013

On 11.03.2013 01:54, Andrej Mitrovic wrote:

Is it correct to just call this external app like that? xfBuild used an elaborate way to call the SetProcessAffinityMask function, and it was specifically made to tame Optlink, see here.

I think setting the affinity in the exe header is ok. The only drawback
I see is that the process is fixed to the first core, so multiple
instances of optlink (or any other program applying the same technique)
will not run in parallel on other cores.
Randomizing the core by setting the affinity from within optlink might
be better, but I don't think anyone has complained that the linking has
taken too long so far.

@WalterBright
Copy link
Contributor

I think it would be better if optlink, upon startup, could say "stay on this core". But I don't know if there's a windows api to do that.

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.

None yet

3 participants