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

Visual C/C++ compatibility #162

Closed
wants to merge 161 commits into from
Closed

Conversation

jd-gascuel
Copy link

Hi Joel,

I started a fork to try to make changes to ccache, so we can compile and use it for windows.
In the following you will see:

  • A bunch of small cleanups to make Visual compiler happy. Mostly bad includes and missing definition on windows. All them should be completly transparent, and I think will improve the main branch quality.
  • There is a few 32/64 bits issues that might deserve a better correction. I just casted them down to 32 bits...
  • I added a compiler_is_msvc() at the top of ccache.c, and started a table of options specific to the Visual compilers.
  • Plus a few management of specific options.

So it starts to work, and knows how to compile itself.

Known issues:

  • cl compiler do write part of the error messages into stdout, and other parts to stderr. This cannot be avoided... So I just made a concatenation of stdour+stderr->stderr. Not very clean, and a better approach might be: 1) to change the execute() function to have only one file, or 2) have ccache to can both stdout and stderr outputs. Note both solution won't keep sync between lines send to stdout and stderr, which might be confusing... but is truly microsoft's fault.
  • cl options can be /option or -option : I did not deal with that properly yet. But this should not be too hard.
  • I should investigate on @file support.
  • I have not a very clear view of what option shall be and shall not be in the compopts_msvc table.

Futur ?
The main question here is: how to contribute that to ccache ?

  • Are you happy to have a windows branch in the official ccache repo ? and to merge it to the default trunk once it works great ?
  • Is there a way to can other annex files (cl generates .sbr files with complete symbolic information) into the cache, so we can restore them too ?

Best regards,

Note: I used Visual 2015 to compile, because earlier version will shock on variable definition inside for().

Add Windows specific includes
…sis.

FIX: option /FoDebug/x64/ can be just a directory: concatenate the object name.
@jd-gascuel jd-gascuel changed the title Windows Visual C/C++ compatibility Mar 11, 2017
schiele pushed a commit to schiele/ccache that referenced this pull request May 27, 2020
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no
space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc
only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so
concat wit…
schiele pushed a commit to schiele/ccache that referenced this pull request May 31, 2020
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no
space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc
only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so
concat wit…
schiele pushed a commit to schiele/ccache that referenced this pull request Jun 2, 2020
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no
space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc
only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so
concat wit…
schiele pushed a commit to schiele/ccache that referenced this pull request Jun 7, 2020
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no
space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc
only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so
concat wit…
schiele pushed a commit to schiele/ccache that referenced this pull request Jun 9, 2020
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no
space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc
only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so
concat wit…
schiele pushed a commit to schiele/ccache that referenced this pull request Jun 15, 2020
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no
space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc
only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so
concat wit…
schiele pushed a commit to schiele/ccache that referenced this pull request Jun 17, 2020
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no
space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc
only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so
concat wit…
schiele pushed a commit to schiele/ccache that referenced this pull request Jun 18, 2020
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no
space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc
only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so
concat wit…
schiele pushed a commit to schiele/ccache that referenced this pull request Jun 22, 2020
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no
space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc
only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so
concat wit…
schiele pushed a commit to schiele/ccache that referenced this pull request Jun 23, 2020
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no
space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc
only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so
concat wit…
schiele pushed a commit to schiele/ccache that referenced this pull request Jun 25, 2020
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no
space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc
only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so
concat wit…
cristianadam added a commit to cristianadam/ccache that referenced this pull request Feb 11, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
cristianadam added a commit to cristianadam/ccache that referenced this pull request Feb 11, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
cristianadam added a commit to cristianadam/ccache that referenced this pull request Feb 14, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
cristianadam added a commit to cristianadam/ccache that referenced this pull request Mar 29, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
thehink pushed a commit to HiberWorld/ccache that referenced this pull request Jul 6, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
cristianadam added a commit to cristianadam/ccache that referenced this pull request Aug 21, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
cristianadam added a commit to cristianadam/ccache that referenced this pull request Aug 21, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
cristianadam added a commit to cristianadam/ccache that referenced this pull request Sep 26, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
cristianadam added a commit to cristianadam/ccache that referenced this pull request Sep 26, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
rvogg pushed a commit to jhnc-oss/ccache that referenced this pull request Oct 26, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
rvogg pushed a commit to jhnc-oss/ccache that referenced this pull request Oct 26, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
llunak pushed a commit to llunak/ccache that referenced this pull request Oct 31, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
cristianadam added a commit to cristianadam/ccache that referenced this pull request Nov 5, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
64449d6: use common code for gcc an cl response files.
cristianadam added a commit to cristianadam/ccache that referenced this pull request Nov 14, 2021
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
64449d6: use common code for gcc an cl response files.
orgads pushed a commit to orgads/ccache that referenced this pull request Jan 7, 2022
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
orgads pushed a commit to orgads/ccache that referenced this pull request Jan 7, 2022
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
orgads pushed a commit to orgads/ccache that referenced this pull request Jan 7, 2022
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
orgads pushed a commit to orgads/ccache that referenced this pull request Jan 7, 2022
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
orgads pushed a commit to orgads/ccache that referenced this pull request Jan 7, 2022
I picked only the compiler commits from:
ccache#162

The following commits I've adapted to the latest ccache C++ code:

375fe24: Add compiler_is_msvc() and MSVC specific option table.
7e01763: Add handling of /Fo option (replaces -o, but shall have no space)
0c5cd25: Manage /E, /c equivalence. -g is gcc only. -O or /O is msvc only.
4f61b59: MSVC send part of the error/warning messages to STDOUT, so concat wit…
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.

4 participants