bin/104425: c++ vs. fesetenv: undefined reference to __test_sse()

Wes Peters wes at softweyr.com
Sat Oct 14 11:30:22 PDT 2006


>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 at zaphod.softweyr.com:/usr/obj/usr/src/sys/ZAPHOD  i386
>Description:
wes at 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 at 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 at 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 at zaphod$ cc -g hello.c -lm
wes at 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:


More information about the freebsd-bugs mailing list