Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Oct 2006 18:27:58 GMT
From:      Wes Peters<wes@softweyr.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/104425: c++ vs. fesetenv: undefined reference to __test_sse()
Message-ID:  <200610141827.k9EIRwde021787@www.freebsd.org>
Resent-Message-ID: <200610141830.k9EIULCi097285@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         104425
>Category:       bin
>Synopsis:       c++ vs. fesetenv: undefined reference to __test_sse()
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 14 18:30:19 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Wes Peters
>Release:        6.2-PRERELEASE
>Organization:
FreeBSD
>Environment:
FreeBSD zaphod.softweyr.com 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #4: Thu Oct 12 08:51:53 PDT 2006     rootb@zaphod.softweyr.com:/usr/obj/usr/src/sys/ZAPHOD  i386
>Description:
wes@zaphod$ cat hello.cc
#include <iostream>
#include <fenv.h>

using namespace std;

int main(int argc, char *argv[])
{
        fenv_t envp;
        int i = fegetenv(&envp);
        fesetenv(&envp);
        cout << "Hello, world" << endl;
}

wes@zaphod$ c++ -g hello.cc -lm
/var/tmp//ccgJGfUg.o(.text+0x1b6): In function `fesetenv':
/usr/include/fenv.h:211: undefined reference to `__test_sse()'

The problem seems to lie in the C++ runtime startup, the nearly identical C program has no problems:

wes@zaphod$ cat hello.c
#include <stdio.h>
#include <fenv.h>
#pragma STDC FENV_ACCESS ON

int main(int argc, char *argv[])
{
        fenv_t envp;
        int i = fegetenv(&envp);
        fesetenv(&envp);
        printf("Hello, world\n");
}
wes@zaphod$ cc -g hello.c -lm
wes@zaphod$ ./a.out
Hello, world

>How-To-Repeat:
Attempt to compile any C++ program that calls fesetenv.
>Fix:
Still working on it.  This may be a show-stopper for release, if we care about C++ and floating-point support.
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610141827.k9EIRwde021787>