[Bug 1639531] [NEW] GCC compiles programs to shared object instead of executable, preventing GUI file managers from executing programs

Olathe erlercw+launchpad at gmail.com
Sun Nov 6 02:51:07 UTC 2016


Public bug reported:

Release of Ubuntu being used
============================

Description:    Ubuntu 16.10
Release:        16.10

Version of the package being used
=================================

gcc:
  Installed: 4:6.1.1-1ubuntu2
  Candidate: 4:6.1.1-1ubuntu2
  Version table:
 *** 4:6.1.1-1ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu yakkety/main amd64 Packages
        100 /var/lib/dpkg/status

What was expected
=================

Programs compiled using `gcc -o program program.c` should be runnable by
double-clicking them from a GUI file manager.

Compiling a simple program (`void main() { }`) using Xubuntu 16.04's
current version of `gcc` (`gcc version 5.4.0 20160609 (Ubuntu
5.4.0-6ubuntu1~16.04.2)`) produces the following output from
`/usr/bin/file program`:

    program: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for
GNU/Linux 2.6.32, BuildID[sha1]=signature_here, not stripped

This is correct behavior, allowing the executables to run from Nautilus
and Thunar.

What happened instead
=====================

Programs compiled using `gcc -o program program.c` are not runnable by
double-clicking them from a GUI file manager, even though they are
runnable from the terminal.

Compiling a simple program (`void main() { }`) using the current version
of `gcc` (`6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12)`) produces the
following output from `/usr/bin/file program`:

    program: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for
GNU/Linux 2.6.32, BuildID[sha1]=signature_here, not stripped

The program is also identified as a "shared library" instead of an
"executable" in Thunar, causing it to not be runnable from the GUI.
Others are unable to run such programs from Nautilus.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: gcc 4:5.3.1-1ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-45.66-generic 4.4.21
Uname: Linux 4.4.0-45-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: XFCE
Date: Sat Nov  5 22:09:39 2016
EcryptfsInUse: Yes
SourcePackage: gcc-defaults
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: gcc-defaults (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug xenial

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/1639531

Title:
  GCC compiles programs to shared object instead of executable,
  preventing GUI file managers from executing programs

Status in gcc-defaults package in Ubuntu:
  New

Bug description:
  Release of Ubuntu being used
  ============================

  Description:    Ubuntu 16.10
  Release:        16.10

  Version of the package being used
  =================================

  gcc:
    Installed: 4:6.1.1-1ubuntu2
    Candidate: 4:6.1.1-1ubuntu2
    Version table:
   *** 4:6.1.1-1ubuntu2 500
          500 http://archive.ubuntu.com/ubuntu yakkety/main amd64 Packages
          100 /var/lib/dpkg/status

  What was expected
  =================

  Programs compiled using `gcc -o program program.c` should be runnable
  by double-clicking them from a GUI file manager.

  Compiling a simple program (`void main() { }`) using Xubuntu 16.04's
  current version of `gcc` (`gcc version 5.4.0 20160609 (Ubuntu
  5.4.0-6ubuntu1~16.04.2)`) produces the following output from
  `/usr/bin/file program`:

      program: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
  dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for
  GNU/Linux 2.6.32, BuildID[sha1]=signature_here, not stripped

  This is correct behavior, allowing the executables to run from
  Nautilus and Thunar.

  What happened instead
  =====================

  Programs compiled using `gcc -o program program.c` are not runnable by
  double-clicking them from a GUI file manager, even though they are
  runnable from the terminal.

  Compiling a simple program (`void main() { }`) using the current
  version of `gcc` (`6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12)`) produces
  the following output from `/usr/bin/file program`:

      program: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV),
  dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for
  GNU/Linux 2.6.32, BuildID[sha1]=signature_here, not stripped

  The program is also identified as a "shared library" instead of an
  "executable" in Thunar, causing it to not be runnable from the GUI.
  Others are unable to run such programs from Nautilus.

  ProblemType: Bug
  DistroRelease: Ubuntu 16.04
  Package: gcc 4:5.3.1-1ubuntu1
  ProcVersionSignature: Ubuntu 4.4.0-45.66-generic 4.4.21
  Uname: Linux 4.4.0-45-generic x86_64
  ApportVersion: 2.20.1-0ubuntu2.1
  Architecture: amd64
  CurrentDesktop: XFCE
  Date: Sat Nov  5 22:09:39 2016
  EcryptfsInUse: Yes
  SourcePackage: gcc-defaults
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1639531/+subscriptions



More information about the foundations-bugs mailing list