Ticket #1862 (closed bug: fixed)

Opened 11 years ago

Last modified 11 years ago

Configure.pl should actually test for gcc -fvisibility=hidden support

Reported by: doughera Owned by: jkeenan
Priority: normal Milestone: 2.11
Component: configure Version: 2.10.0
Severity: medium Keywords:
Cc: Language:
Patch status: applied Platform:

Description

Currently, Configure.pl tests (in config/auto/warnings.pm) whether the compiler accepts the gcc option -fvisibility=hidden. Independently, in config/auto/gcc.pm, Configure.pl sets attribute((visibility("default")) for gcc versions >= 4.0. Normally, this works fine, since -fvisibility=hidden is not part of the official gcc releases prior to 4.0.

However, in TT #1832 and TT #1255, it looks like users were running a version of gcc-3.4.6 that had been patched to accept -fvisibility=hidden. The net result is that the build failed with linker errors.

Parrot should make the tests consistent for the command line option -fvisibility and the attribute((visibility("default")). Either both should be enabled only for gcc >= 4.0, or both should be enabled only when an appropriate test file can be successfully compiled.

Attachments

auto.warnings.visibility.patch Download (1.7 KB) - added by jkeenan 11 years ago.
patch requiring gcc >=4.0 for -fvisibility=hidden

Change History

follow-up: ↓ 2   Changed 11 years ago by jkeenan

  • status changed from new to assigned
  • owner set to jkeenan
  • component changed from none to configure

Andy,

Would the patch attached, auto.warnings.visibility.patch, satisfy your second alternative?

Thank you very much.

kid51

Changed 11 years ago by jkeenan

patch requiring gcc >=4.0 for -fvisibility=hidden

in reply to: ↑ 1 ; follow-up: ↓ 3   Changed 11 years ago by doughera

Replying to jkeenan:

Andy, Would the patch attached, auto.warnings.visibility.patch, satisfy your second alternative?

Almost -- I think you'd have to delete the test in line 300, since sym_export will already be defined by that point for gcc >= 4.0 -- but yes, this should work. Thanks for cooking up the patch.

in reply to: ↑ 2   Changed 11 years ago by jkeenan

  • patch set to applied

Replying to doughera:

Almost -- I think you'd have to delete the test in line 300, since sym_export will already be defined by that point for gcc >= 4.0 -- but yes, this should work. Thanks for cooking up the patch.

I modified the patch per Andy's suggestion. I then configured in two ways: first with gcc-3.3, second with gcc-4.something. In the first case 'visibility' was not found in lib/Parrot/Config/Generated.pm; in the second case it was. So I think this demonstrates the patch achieved its end.

Committed to master in commit 3b80d03. Will keep the patch open until the weekend for comments or complaints.

Thank you very much.

kid51

  Changed 11 years ago by jkeenan

  • status changed from assigned to closed
  • resolution set to fixed

No complaints; closing ticket.

Thank you very much.

kid51

Note: See TracTickets for help on using tickets.