MySQL Forums
Forum List  »  Install & Repo

use the source.tar.gz to build my-rpm package
Posted by: hamasaki ayumi
Date: November 10, 2015 08:20PM

Morning,I install mysql-5.7.9 from source code on centos7.1,it install success.but now I want use the mysql5.7.9 source to rpmbuild my-rpm package for other centos7.1 , when 'make',it found an error, it looks like this: '/root/mysql-5.7.9/storage/innobase/include/ut0new.h:324:27: error: exception handling disabled, use -fexceptions to enable
throw(std::bad_alloc());'
This is my mysql.spec:

Name: mysql
Version:5.7.9
Release: %(echo $RELEASE)%{?dist}
License: GPL
Group: applications/database
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: cmake
Packager: bamqjurgg@gmail.com
Autoreq: no
#Source: %{name}-%{version}.tar.gz
prefix: /usr/local/mysql
Summary: MySQL 5.7.9

%description
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
and robust SQL (Structured Query Language) database server. MySQL Server
is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software.

%define MYSQL_USER mysql
%define MYSQL_GROUP mysql
%define __os_install_post %{nil}

%build
cd $OLDPWD/../
CFLAGS="-O3 -g -fno-exceptions -static-libgcc -fno-omit-frame-pointer -fno-stri
ct-aliasing"
CXX=g++
CXXFLAGS="-O3 -g -fno-exceptions -fno-rtti -static-libgcc -fno-omit-frame-point
er -fno-strict-aliasing"
export CFLAGS CXX CXXFLAGS

cmake . \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=../ \
-DCMAKE_INSTALL_PREFIX:PATH=%{prefix} \
-DSYSCONFDIR:PATH=%{prefix} \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DENABLED_LOCAL_INFILE=1;
make

%install
cd $OLDPWD/../
make DESTDIR=$RPM_BUILD_ROOT install

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, %{MYSQL_USER}, %{MYSQL_GROUP})
%attr(755, %{MYSQL_USER}, %{MYSQL_GROUP}) %{prefix}/*

%pre

%post
ln -s %{prefix}/lib %{prefix}/lib64

%preun

%changelog




and this is the error:

[ 11%] Building C object mysys/CMakeFiles/mysys.dir/thr_cond.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/thr_lock.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/thr_mutex.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/thr_rwlock.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/tree.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/typelib.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/base64.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/my_memmem.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/lf_alloc-pin.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/lf_dynarray.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/lf_hash.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/my_rdtsc.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/psi_noop.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/my_syslog.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/my_chmod.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/my_thread.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/posix_timers.c.o
[ 13%] Building C object mysys/CMakeFiles/mysys.dir/my_largepage.c.o
Linking C static library libmysys.a
[ 13%] Built target mysys
Scanning dependencies of target dbug
[ 13%] Building C object dbug/CMakeFiles/dbug.dir/dbug.c.o
Linking C static library libdbug.a
[ 13%] Built target dbug
Scanning dependencies of target mysys_ssl
[ 13%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/crypt_genhash_impl.cc.o
[ 13%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/mf_tempdir.cc.o
[ 13%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_default.cc.o
[ 13%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_getopt.cc.o
[ 13%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_aes.cc.o
[ 13%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_sha1.cc.o
[ 13%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_sha2.cc.o
[ 13%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_md5.cc.o
[ 13%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_rnd.cc.o
[ 14%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_murmur3.cc.o
[ 14%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_aes_yassl.cc.o
Linking CXX static library libmysys_ssl.a
[ 14%] Built target mysys_ssl
Scanning dependencies of target comp_err
[ 14%] Building C object extra/CMakeFiles/comp_err.dir/comp_err.c.o
Linking CXX executable comp_err
[ 14%] Built target comp_err
[ 14%] Generating ../include/mysqld_error.h, ../sql/share/english/errmsg.sys
[ 14%] Built target GenError
[ 14%] Building C object extra/CMakeFiles/lz4_lib.dir/lz4/lz4.c.o
[ 14%] Building C object extra/CMakeFiles/lz4_lib.dir/lz4/lz4frame.c.o
[ 14%] Building C object extra/CMakeFiles/lz4_lib.dir/lz4/lz4hc.c.o
[ 14%] Building C object extra/CMakeFiles/lz4_lib.dir/lz4/xxhash.c.o
Linking C static library liblz4_lib.a
[ 14%] Built target lz4_lib
Scanning dependencies of target innobase
[ 14%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/api/api0api.cc.o
In file included from /root/mysql-5.7.9/storage/innobase/include/sync0types.h:32:0,
from /root/mysql-5.7.9/storage/innobase/include/univ.i:594,
from /root/mysql-5.7.9/storage/innobase/include/ha_prototypes.h:32,
from /root/mysql-5.7.9/storage/innobase/api/api0api.cc:27:
/root/mysql-5.7.9/storage/innobase/include/ut0new.h: In instantiation of 'T* ut_allocator<T>::allocate(ut_allocator<T>::size_type, ut_allocator<T>::const_pointer, const char*, bool, bool) [with T = unsigned char; ut_allocator<T>::pointer = unsigned char*; ut_allocator<T>::size_type = long unsigned int; ut_allocator<T>::const_pointer = const unsigned char*]':
/root/mysql-5.7.9/storage/innobase/include/sync0types.h:613:12: required from here
/root/mysql-5.7.9/storage/innobase/include/ut0new.h:324:27: error: exception handling disabled, use -fexceptions to enable
throw(std::bad_alloc());
^
make[2]: *** [storage/innobase/CMakeFiles/innobase.dir/api/api0api.cc.o] Error 1
make[1]: *** [storage/innobase/CMakeFiles/innobase.dir/all] Error 2
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.nuSZ7o (%build)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.nuSZ7o (%build)


any one can help me? forgive my pool english!
here is a temporary vps in tokyo and it provide the files and environment for test. user:root passwd:freebsd thanks.have a nice day!

Options: ReplyQuote


Subject
Written By
Posted
use the source.tar.gz to build my-rpm package
November 10, 2015 08:20PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.