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

gcc 8 and 9 values linking may not be right #32

Open
jlevon opened this issue Dec 17, 2019 · 5 comments
Open

gcc 8 and 9 values linking may not be right #32

jlevon opened this issue Dec 17, 2019 · 5 comments

Comments

@jlevon
Copy link

jlevon commented Dec 17, 2019

During some investigation, we noticed that the illumos gcc 8 and 9 may not be
choosing to link values-xpg[46].c in the same way as our earlier versions.

We should investigate this and fix the specs files as needed. We definitely do not want to be accidentally including xpg4 everywhere.

@jlevon
Copy link
Author

jlevon commented Dec 17, 2019

For example look at

https://gist.github.com/citrus-it/96d579c065c9497f1f4c8ca0cb342904

STARTFILE_ARCH_SPEC change. This is from illumos/gcc 8.x branch to OmniOS's version. We need at least this change.

@citrus-it
Copy link
Member

gcc 4 / stock gcc 7

%{ansi:values-Xc.o%s}
%{!ansi:values-Xa.o%s}

illumos gcc7

%{
      std=c1x|std=gnu1x:values-Xc.o%s values-xpg6.o%s;
      std=c11|std=gnu11:values-Xc.o%s values-xpg6.o%s;
      std=c99|std=gnu99:values-Xc.o%s values-xpg6.o%s;
      std=c9x|std=gnu9x:values-Xc.o%s values-xpg6.o%s;
      std=c++0x|std=gnu++0x:values-Xc.o%s;
      std=c++11|std=gnu++11:values-Xc.o%s;
      std=c++03|std=gnu++03:values-Xc.o%s;
      :values-Xa.o%s
}

stock/illumos gcc8

%{!shared:%{!symbolic:
      %{ansi|std=c*|std=iso9899\\:199409:values-Xc.o%s; :values-Xa.o%s}
      %{std=c90|std=gnu90:values-xpg4.o%s; :values-xpg6.o%s}
}}

@citrus-it
Copy link
Member

I suspect we should probably use something like:

%{!shared:%{!symbolic:
      %{ansi|std=c*|std=iso9899\\:199409:values-Xc.o%s; :values-Xa.o%s}
      %{std=c89|std=gnu89:;
        std=c90|std=gnu90:values-xpg4.o%s; :values-xpg6.o%s}
}}

(assuming that syntax works)

@citrus-it
Copy link
Member

I did a comparison of the values files between gcc 7, 8 and 9 on OpenIndiana. The results are summarised below:

flags gcc7 gcc8 gcc9
c89 32 Xa Xc xpg4 Xc xpg4
c89 32 -ansi Xa Xc xpg4 Xc xpg4
c89 64 Xa Xc xpg4 Xc xpg4
c89 64 -ansi Xa Xc xpg4 Xc xpg4
c90 32 Xa Xc xpg4 Xc xpg4
c90 32 -ansi Xa Xc xpg4 Xc xpg4
c90 64 Xa Xc xpg4 Xc xpg4
c90 64 -ansi Xa Xc xpg4 Xc xpg4
c99 32 Xc xpg6 Xc xpg6 Xc xpg6
c99 32 -ansi Xc xpg6 Xc xpg6 Xc xpg6
c99 64 Xc xpg6 Xc xpg6 Xc xpg6
c99 64 -ansi Xc xpg6 Xc xpg6 Xc xpg6
c11 32 Xc xpg6 Xc xpg6 Xc xpg6
c11 32 -ansi Xc xpg6 Xc xpg6 Xc xpg6
c11 64 Xc xpg6 Xc xpg6 Xc xpg6
c11 64 -ansi Xc xpg6 Xc xpg6 Xc xpg6
gnu89 32 Xa Xa xpg4 Xa xpg4
gnu89 32 -ansi Xa Xc xpg4 Xc xpg4
gnu89 64 Xa Xa xpg4 Xa xpg4
gnu89 64 -ansi Xa Xc xpg4 Xc xpg4
gnu90 32 Xa Xa xpg4 Xa xpg4
gnu90 32 -ansi Xa Xc xpg4 Xc xpg4
gnu90 64 Xa Xa xpg4 Xa xpg4
gnu90 64 -ansi Xa Xc xpg4 Xc xpg4
gnu99 32 Xc xpg6 Xa xpg6 Xa xpg6
gnu99 32 -ansi Xc xpg6 Xc xpg6 Xc xpg6
gnu99 64 Xc xpg6 Xa xpg6 Xa xpg6
gnu99 64 -ansi Xc xpg6 Xc xpg6 Xc xpg6
gnu11 32 Xc xpg6 Xa xpg6 Xa xpg6
gnu11 32 -ansi Xc xpg6 Xc xpg6 Xc xpg6
gnu11 64 Xc xpg6 Xa xpg6 Xa xpg6
gnu11 64 -ansi Xc xpg6 Xc xpg6 Xc xpg6

@citrus-it
Copy link
Member

Having applied the patch in #33 to gcc8, the results are:

flags gcc7 gcc8
c89 32 Xa Xa
c89 32 -ansi Xa Xa
c89 64 Xa Xa
c89 64 -ansi Xa Xa
c90 32 Xa Xa
c90 32 -ansi Xa Xa
c90 64 Xa Xa
c90 64 -ansi Xa Xa
c99 32 Xc xpg6 Xc xpg6
c99 32 -ansi Xc xpg6 Xc xpg6
c99 64 Xc xpg6 Xc xpg6
c99 64 -ansi Xc xpg6 Xc xpg6
c11 32 Xc xpg6 Xc xpg6
c11 32 -ansi Xc xpg6 Xc xpg6
c11 64 Xc xpg6 Xc xpg6
c11 64 -ansi Xc xpg6 Xc xpg6
gnu89 32 Xa Xa
gnu89 32 -ansi Xa Xa
gnu89 64 Xa Xa
gnu89 64 -ansi Xa Xa
gnu90 32 Xa Xa
gnu90 32 -ansi Xa Xa
gnu90 64 Xa Xa
gnu90 64 -ansi Xa Xa
gnu99 32 Xc xpg6 Xa xpg6
gnu99 32 -ansi Xc xpg6 Xc xpg6
gnu99 64 Xc xpg6 Xa xpg6
gnu99 64 -ansi Xc xpg6 Xc xpg6
gnu11 32 Xc xpg6 Xa xpg6
gnu11 32 -ansi Xc xpg6 Xc xpg6
gnu11 64 Xc xpg6 Xa xpg6
gnu11 64 -ansi Xc xpg6 Xc xpg6

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

No branches or pull requests

2 participants